I developed php code in WinXP and moved the website to Linux. I'm getting errors like this:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /.../main.php on line 122
the code is like this:
$result = mysql_query("SELECT name, telephone, email FROM person WHERE id='$member' " ) || die(mysql_error());
if ($myrow = mysql_fetch_array($result, MYSQL_BOTH)) // line 122
{
....
}
if I insert:
$c =count($result);
echo ">$c<";
it will print 1, because it does get a matching row and in the $result.
but I couldn't get value out by using mysql_fetch_array(); I also got warning when I use mysql_num_rows()
The php version is 5.0.3 now in Linux. But I code was written in WinXP with PHP 4.3.3. Can someone help me to solve this? Thanks.