tags:

views:

33

answers:

1

im not to sure why im getting a Warning: mysql_fetch_array(): when running this query

$query="SHOW SLAVE STATUS;";
$result = mysql_db_query("aid", $query, $con); 
A: 

well i use my_db_query because im new to php and thats all i really know well here is the full error

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/admin/domains/ismfast.com/public_html/V3/internal/karl_tools/slave_email.php on line 23

    $query="SHOW SLAVE STATUS;";


$result = mysql_db_query("aid", $query, $con); echo $result;
$r = mysql_fetch_array($result);
if($r['Slave_SQL_Running']=="Yes"){echo $r['Exec_Master_Log_Pos']}
Karl Lenz
@Karl you can edit this info directly into your question. ... And try `echo mysql_error();` after sending the query, it should show why it fails
Pekka
ok thanx ill give that a try
Karl Lenz
ok so it seems i dont have permission "Access denied for user 'repl'@'%' to database 'aid'" the repl user has REPLICATION CLIENT
Karl Lenz
and also REPLICATION slave permissions
Karl Lenz
4 spaces before a line formats as code. To do this select a block an type `ctr-k`
Peter Ajtai