note 104075 added to language.operators.errorcontrol
| From: | pgreviews at gmail dot com | Date: | Sat, 21 May 2011 00:19:30 +0000 |
| Subject: | note 104075 added to language.operators.errorcontrol | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-179921@lists.php.net to get a copy of this message | ||
Using this, you can catch MySQL errors VERY easily, like so:
<?php
//For example, if you were looping through a result-set:
while (@$needle=mysql_fetch_array($haystack) or die("MySQL returned an error. The error was
suppressed, and this message was added instead.")) {
...
}
?>
This is very useful, for example, instead of even showing an error, just stick a
header("Location: ".$_SERVER['HTTP_REFERER']); in it, and the user will be
redirected back to where they came from!
----
Server IP: 92.48.74.199
Probable Submitter: 69.63.51.150
----
Manual Page -- http://www.php.net/manual/en/language.operators.errorcontrol.php
Edit -- https://master.php.net/note/edit/104075
Del: integrated -- https://master.php.net/note/delete/104075/integrated
Del: useless -- https://master.php.net/note/delete/104075/useless
Del: bad code -- https://master.php.net/note/delete/104075/bad+code
Del: spam -- https://master.php.net/note/delete/104075/spam
Del: non-english -- https://master.php.net/note/delete/104075/non-english
Del: in docs -- https://master.php.net/note/delete/104075/in+docs
Del: other reasons-- https://master.php.net/note/delete/104075
Reject -- https://master.php.net/note/reject/104075
Search -- https://master.php.net/manage/user-notes.php