Jump to content

[SOLVED] does mysql_query($query); always have to be followed by or die(mysql_error());


ted_chou12

Recommended Posts

hi, I am having problem with this, I wish to have my own error message instead of "or  die(mysql_error());" because my users dont understand those mysql messages. But it doesnt work if you dont put them there after mysql_query($query);... so is there a way to show my own error message instead of mysql error messages?
Thanks
Ted
If you want more flexibility, you can write it like this:

[code=php:0]$result = mysql_query($sql);
if ($result === false) {
  print "The query to fetch widget ids from the database failed!  Please try again in a few minutes, or send an email to [email protected] if problems persist.  Thankyou for your patience.\n";
  # Do whatever else you want to do..
  exit(0);
}[/code]

Archived

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

×
×
  • Create New...

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.