Jump to content

MYSQL Query Error: supplied argument is not a valid


n1concepts

Recommended Posts

I need someone to look over snippet PHP code I have where I'm trying to query a MySQL db and echo out the results if an exact match - based on the "WHERE" clause is found during the query. See code below:

 

$rcheck = "SELECT docno,fdate,ftime,vegregno,direction,grossmass FROM information where docno = $docnoNew AND fdate = $fdateNew AND ftime = $ftimeNew AND vegregno = $vegregnoNew AND direction = $directionNew AND grossmass = $grossmassNew;";

        $duplicate = mysql_query(rcheck);    // Execute query to check for duplicate transaction in table

        while ($row = mysql_fetch_array($duplicate)) {

            echo $row['docno']."<br/>";
            echo $row['fdate']."<br/>";
            echo $row['ftime']."<br/>";
            echo $row['vegregno']."<br/>";
            echo $row['direction']."<br/>";
            echo $row['grossmass']."<br/>";
}

 

Note: I confirm MySQL connection string/query in SELECT statement is valid and I have connection to the table for other objectives.

However, I keep getting the below error for the stated code shown in this post.

 

My question is, "what arguements are invalid - causing this error - as I confirmed the actual db table field names, the table connection, etc... are all valid?

 

Error which is at the "WHILE" loop line of code:

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

 

??????????  :-\ :confused::shrug::wtf:

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.