I would like to know why am I having some errors doing this:
$query = "SELECT * FROM servers ";
while($rows = mysql_fetch_array(mysql_query($query)))
{
$database1 = array();
$database1['host'] = $rows['db_host'];
$database1['user'] = $rows['db_user'];
$database1['password'] = $rows['db_pass'];
$database1['table'] = $rows['db_user'];
$con1 = @mysql_connect($database1['host'], $database1['user'], $database1['password']) or die($connect_error);
if(!$con1) {
exit;
}
$connect_error = 'Sorry, there are some connection problems.';
mysql_select_db($database1['table']) or die($connect_error);
$info = mysql_fetch_assoc(mysql_query("SELECT COUNT(username) as total FROM authme"));
echo "No servidor ".$rows['name']." existem um total de ".$info['total']. " contas registradas, alem disso";
}
Ok. Lest explain: I have two differents database's, In the fisrt one that I wrote this query:
query = "SELECT * FROM servers ";
I have in the table servers a mysql connections.So I have to connect in diferrent mysqls to get mysql host, user and password.When I get these things, I have to get a value for each one connection and echo this value using COUNT as a variable, when I did that:
$info = mysql_fetch_assoc(mysql_query("SELECT COUNT(username) as total FROM authme"));
echo "No servidor ".$rows['name']." existem um total de ".$info['total']. " contas registradas, alem disso";
I hope that u guys undestand because I dont speak english very well ): and Thank u for your attention..