MySQL Forums
Forum List  »  PHP

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




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.