diff options
author | varnav <varnavruz@gmail.com> | 2015-08-05 13:59:43 +0300 |
---|---|---|
committer | varnav <varnavruz@gmail.com> | 2015-08-05 13:59:43 +0300 |
commit | ec95a2562d4ea7cc7fcb4f0bed6c079312ea1720 (patch) | |
tree | 7e846970b8ad912ac23f87899b0b0f2523063c18 /lamp_simple | |
parent | ce2c7b816c52e04c16cb76218537720d308f5c98 (diff) |
Rewritten for mysql
mysql PHP extension is deprecated, rewritten for mysqli
Diffstat (limited to 'lamp_simple')
-rw-r--r-- | lamp_simple/roles/web/templates/index.php.j2 | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lamp_simple/roles/web/templates/index.php.j2 b/lamp_simple/roles/web/templates/index.php.j2 index 34a59d2..4d15afe 100644 --- a/lamp_simple/roles/web/templates/index.php.j2 +++ b/lamp_simple/roles/web/templates/index.php.j2 @@ -12,10 +12,10 @@ Print "</BR>"; echo "List of Databases: </BR>"; {% for host in groups['dbservers'] %} - $link = mysql_connect('{{ hostvars[host].ansible_default_ipv4.address }}', '{{ hostvars[host].dbuser }}', '{{ hostvars[host].upassword }}') or die(mysql_error()); + $link = mysqli_connect('{{ hostvars[host].ansible_default_ipv4.address }}', '{{ hostvars[host].dbuser }}', '{{ hostvars[host].upassword }}') or die(mysqli_connect_error($link)); {% endfor %} - $res = mysql_query("SHOW DATABASES"); - while ($row = mysql_fetch_assoc($res)) { + $res = mysqli_query($link, "SHOW DATABASES;"); + while ($row = mysqli_fetch_assoc($res)) { echo $row['Database'] . "\n"; } ?> |