mysql_numrows(): supplied argument is not a valid MySQL
Posted: Sun Aug 09, 2009 6:51 am
Code gurus, Hi again,
Please I need a pointer to correct this specific error:
I want to echo out a record specific to the current user but this error:
mysql_numrows(): supplied argument is not a valid MySQL result resource on line 25. Where line 25=
"$num=mysql_numrows($result);"
Please McInfo, Tg, and Jack could you guys give a possible insight as to what could be wrong?
Please I need a pointer to correct this specific error:
Code: Select all
<?php
$pfno=$_GET["pfno"];
$query=mysql_query("Select * From user_table where pfno='$pfno'") or die (mysql_error());
$result=mysql_query($query);
$num=mysql_numrows($result);
echo "<p> PFNO : ".$_SESSION["pfno"]. "<p>Logged in: " .date("m/d/Y", $_SESSION["valid_time"]);
$i=0;
while ($i < $num) {
$pfno = mysql_fetch_assoc($result);
$f1=mysql_result($result,"lname");
$f2=mysql_result($result,"fname");
$f3=mysql_result($result,"oname");
$f4=mysql_result($result,"department");
$i++;
}
echo("<p> Welcome".$f1);
echo ("<p>Department:".$f3);
?>mysql_numrows(): supplied argument is not a valid MySQL result resource on line 25. Where line 25=
"$num=mysql_numrows($result);"
Please McInfo, Tg, and Jack could you guys give a possible insight as to what could be wrong?