Jump to content

mysql_fetch_array


dazzclub

Recommended Posts

Hi guys and girls..

 

I was originally having a problem with something else which made me want to view my site in note pad from the view source in the browser...I was reading the code and i had noticed this..

 

<br />

<b>Warning</b>:  mysql_fetch_array(): supplied argument is not a valid MySQL result resource in <b>C:\wamp\www\darrensPAINT\density-graphs.php</b> on line <b>94</b><br />

</select>

 

I was surpised i had not seen it in the browser first..anyway..

 

I tracked it down to line 94 and looked at the lines previous to help me spot the problem..I then read a tutorial by Ben Smithers  on,  "Debugging: A Beginner's guide" on phpfreaks and i tried to echo out the problem, as this was suggested to be a good method but i think i messed up somewhere.

 

here is the code thats causing the error, along with my attempt at echoing out the problem

//third dropdown list

echo "<select name='time'><option value=''>Select time</option>";

while($selectiontime= mysql_fetch_array($querytime) or trigger_error(mysql_error().'<br />Query was:'.$selectiontime);

echo '<br />'.Query was:'.$selectiontime.'<br />';

 

If anyone can help, that would be great :)

 

cheers

Darren

 

 

 

Link to comment
Share on other sites

$selectiontime is an array that holds the results of the resource $querytime has from mysql.

 

You need to echo the same $variable that is in the "mysql_query($variable)" area in order to debug to see that what you're asking mysql for.

Also, it would help us to have more code, specifically what sql you're sending.

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.