Jump to content

Archived

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

luvburn

mysql error

Recommended Posts

I got this error everytime i load mypage

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

the error is at the line '$myrow = mysql_fetch_array($result);' from this part

[code]
<?php
$query= "SELECT * FROM jawapan WHERE kategori = '$tanda' AND idsimptom = '$id'";
$result = mysql_db_query($dbc,$query);
$myrow = mysql_fetch_array($result);
?>
[/code]

Then i try to put '@'  in front of the error code, but the code returns nothing from the sql statement.

Share this post


Link to post
Share on other sites
[code]<?php
$query= "SELECT * FROM jawapan WHERE kategori = '$tanda' AND idsimptom = '$id'";
$result = mysql_db_query($dbc,$query);
$myrow = mysql_fetch_assoc($result);
?>[/code]

All I did there was change array -> assoc. That should work the same unless you need it split up into arrays. Try that and see what happens.

Share this post


Link to post
Share on other sites
You can verify what's happening with the query execution:

[code]$result = mysql_db_query($dbc,$query) or die("Error: ". mysql_error(). " with query ". $query);// show problems[/code]

Share this post


Link to post
Share on other sites

×

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.