Warning:mysql_fetch_array (): supplied argument is not a valid MySQL result resource in
$connect =mysql_connect ("localhost", "root", "123") or Die ("Unable to connect to database". Mysql_error ());
mysql_select_db ("Cmstest") or Die ("Cannot select Database". Mysql_errno ());
$sql = "SELECT * from article where pid=1";
$result =mysql_query ($sql, $connect) or Die ("SQL statement cannot be queried". Mysql_error ());
$nums =mysql_num_rows ($result);
echo "Nums is:". $nums;
while ($res =mysql_fetch_array ($result)) {
echo $res [0];
}
The original is $result repeated.
http://www.bkjia.com/PHPjc/632485.html www.bkjia.com true http://www.bkjia.com/PHPjc/632485.html techarticle Warning:mysql_fetch_array (): supplied argument is not a valid MySQL result resource in $connect =mysql_connect (Localho st,root,123) or Die (unable to connect to the database. Mysql_error ()); MYSQ ...