luvburn Posted September 18, 2006 Share Posted September 18, 2006 I got this error everytime i load mypageWarning: 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. Link to comment https://forums.phpfreaks.com/topic/21113-mysql-error/ Share on other sites More sharing options...
pocobueno1388 Posted September 18, 2006 Share Posted September 18, 2006 [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. Link to comment https://forums.phpfreaks.com/topic/21113-mysql-error/#findComment-93781 Share on other sites More sharing options...
AndyB Posted September 18, 2006 Share Posted September 18, 2006 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] Link to comment https://forums.phpfreaks.com/topic/21113-mysql-error/#findComment-93785 Share on other sites More sharing options...
luvburn Posted September 18, 2006 Author Share Posted September 18, 2006 thanks..i got it! Link to comment https://forums.phpfreaks.com/topic/21113-mysql-error/#findComment-93792 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.