Jump to content


MySQL Question


  • Please log in to reply
3 replies to this topic

#1 Guest_ShaneLarson_*

Guest_ShaneLarson_*
  • Guests

Posted 30 September 2006 - 04:50 AM

What do you edit to
or die ("");
to display what the error is caused off of.

#2 Gaoshan

Gaoshan
  • Members
  • PipPip
  • Member
  • 25 posts

Posted 30 September 2006 - 04:53 AM

<?php
$result = mysql_query('SELECT * WHERE 1=1');
if (!$result) {
    die('Invalid query: ' . mysql_error());
}

?>


#3 Guest_ShaneLarson_*

Guest_ShaneLarson_*
  • Guests

Posted 30 September 2006 - 04:55 AM

Thanks

#4 alpine

alpine
  • Members
  • PipPipPip
  • Advanced Member
  • 756 posts
  • LocationNorway

Posted 30 September 2006 - 05:00 AM

No need to run an IF test, the one-line version

$sql = mysql_query("select * from table") or die(mysql_error());




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users