mirror of
https://github.com/geerlingguy/ansible-role-apache
synced 2025-01-09 19:30:18 +01:00
Rewritten for mysql
mysql PHP extension is deprecated, rewritten for mysqli
This commit is contained in:
parent
ce2c7b816c
commit
ec95a2562d
1 changed files with 3 additions and 3 deletions
|
@ -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";
|
||||
}
|
||||
?>
|
||||
|
|
Loading…
Reference in a new issue