Possible Duplicate:
mysql_fetch_array() expects parameter 1 to be resource, boolean given in select
<?php
$con=mysql_connect('localhost','root','');
mysql_selectDb('cms',$con);
$con2=mysql_connect('localhost','root','');
mysql_selectDb('cms2',$con2);
$memberId="Member0001";
$select2=mysql_query("select * from member_register where memberID='$memberId'",$con);
$row2=mysql_fetch_array($select2);
?>
i got a code like above, select 2 database from 1 server, sure the code is right, but it appear
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in xxx on line xxx
There is no need to maintain two connections to the same DB server with the same credentials. You can trivally use
using the same single connection. Two connections would only really be needed if you have to connect using DIFFERENT credentials.
In your case, since you’re getting a ‘boolean received’, your query failed, and you simply assumed it succeeded (NOT a good idea). Try:
to find out WHY the query failed.