Possible Duplicate:
mysql_fetch_array() expects parameter 1 to be resource, boolean given in select
I have tow mysql data bases. the first data base location is latin1_swedish_ci and the second data base is utf_unicode_ci.I am trying to read tha data bases with tha php code below.
<?php
mysql_connect("localhost","admin","***");
mysql_select_db("MyDB");
$sql=mysql_query("select * from menu where avail=1");
while($row=mysql_fetch_assoc($sql))
$output[]=$row;
print(json_encode($output));
mysql_close();
?>
When I am runing this code via my php server the first data base the one with latin1_swedish_ci is readed but when I am trying to read the second one it displays the following messages:
"Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in...."
"Notice: Undefined variable: output in...."
I tried to give mysql_query("SET NAMES utf8;"); in my code but it didnt worked Can anyone tell me what is going wrong here?