[SOLVED] Confusing 'not a valid MySQL result resource' error
Posted: Sat Jul 24, 2004 6:01 am
Dear All,
For this piece of code:
I get the following error:
Line 102 is the mysql_query line. I have had a problem like this just previous to this, which I solved by substituting the variable '$result' for '$myresult'. It now works.
I've never had this problem before and this doesn't seem to work this time. It would be best to understand the underlying cause.
Can anyone elaborate on why it is doing this?
Many thanks
Mark
For this piece of code:
Code: Select all
$query5 = 'SELECT * FROM CommissionTermPayments WHERE CustomerID='.$row2['CustomerID'].' AND CommissionTermID='.$row4['CommissionTermID'];
$myresult5 = mysql_fetch_array( $query5 );
if(!$myresult5)
{
do_html_message('Error: Could not perform MySQL query - '.mysql_error());
do_html_footer();
exit();
}Code: Select all
Warning: Supplied argument is not a valid MySQL result resource in /home/XXXX/public_html/sales.php on line 102I've never had this problem before and this doesn't seem to work this time. It would be best to understand the underlying cause.
Can anyone elaborate on why it is doing this?
Many thanks
Mark