MySQL Forums :: PHP :: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource


Advanced Search

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource
Posted by: john_chooiyoke ()
Date: March 20, 2007 01:44AM

Hi there

The application accepts a 'no' (a number) from a HTML form and takes the number to retrieve the relevant record from a database table. However, the error appears (as stated below):

This is the snippet of code that I think is causing the problem.

$no = $_POST['no'];

$sql2 = 'SELECT region, type, job, location, designation, description, wwwreg, wwwdesc, datecreated, datemodified, deleteforwww, moreinformation FROM openings where no = "$no"';

$result2 = mysqli_query($cxn, $sql2)
or die("Could not execute query: ".mysqli_error($cxn));

$row = mysql_fetch_assoc($result2);

The error message is:

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource


I know that either I type the SQL wrong but I can't see anything in it that is wrong or that MySQL fails to retrieve the relevant record. But why. Pls assist.

Options: ReplyQuote


Subject Written By Posted
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource john_chooiyoke 03/20/2007 01:44AM
Re: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource Peter Brawley 03/20/2007 01:32PM
Re: Error message disappeared but no data as yet john_chooiyoke 03/21/2007 01:42AM
Re: Error message disappeared but no data as yet Peter Brawley 03/21/2007 08:44AM
Re: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource Jeff Li 03/22/2007 09:00AM
Re: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource Adrian Danciu 06/16/2009 03:55AM
Re: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource Peter Brawley 06/16/2009 10:49AM
Re: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource Adrian Danciu 06/16/2009 01:05PM
Re: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource Peter Brawley 06/16/2009 01:56PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.