Jump to content


Photo

mysql error


  • Please log in to reply
3 replies to this topic

#1 luvburn

luvburn
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 18 September 2006 - 02:53 AM

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

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

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

#2 pocobueno1388

pocobueno1388
  • Members
  • PipPipPip
  • Advanced Member
  • 3,369 posts
  • LocationPalm Beach, Florida

Posted 18 September 2006 - 03:03 AM

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

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.

#3 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 18 September 2006 - 03:13 AM

You can verify what's happening with the query execution:

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

Legend has it that reading the manual never killed anyone.
My site

#4 luvburn

luvburn
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 18 September 2006 - 03:31 AM

thanks..i got it!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users