Jump to content


Photo

mysql qeury errors


  • Please log in to reply
2 replies to this topic

#1 esgaroth

esgaroth
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 05 November 2005 - 05:20 PM

i have a few sql queries that are not working. is there any way to get mysql or php to tell me why the query is failing? my apache log file tells me nothing about mysql and the mysql log file only tells me about server errors. am i missing something obvious?

#2 ryanlwh

ryanlwh
  • Staff Alumni
  • Advanced Member
  • 511 posts

Posted 05 November 2005 - 05:36 PM

mysql_error() coupled with die() or echo
$result = mysql_query($sql) or die(myql_error()); 
//some coders like this
$result = mysql_query($sql);
if(!$result) echo mysql_error();

Please use EDIT * 100...
Please use
or [php] * 1000...

PLEASE READ THE POSTED SOLUTIONS CAREFULLY * 1000000...

#3 esgaroth

esgaroth
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 05 November 2005 - 06:51 PM

thanks, exactly what i was looking for.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users