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:

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.