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
https://forums.phpfreaks.com/topic/109868-mysql_fetch_array/
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
https://forums.phpfreaks.com/topic/109868-mysql_fetch_array/#findComment-563770
Share on other sites

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.