mirror of
https://github.com/geerlingguy/ansible-role-apache
synced 2025-01-10 11:50: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>";
|
Print "</BR>";
|
||||||
echo "List of Databases: </BR>";
|
echo "List of Databases: </BR>";
|
||||||
{% for host in groups['dbservers'] %}
|
{% 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 %}
|
{% endfor %}
|
||||||
$res = mysql_query("SHOW DATABASES");
|
$res = mysqli_query($link, "SHOW DATABASES;");
|
||||||
while ($row = mysql_fetch_assoc($res)) {
|
while ($row = mysqli_fetch_assoc($res)) {
|
||||||
echo $row['Database'] . "\n";
|
echo $row['Database'] . "\n";
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in a new issue