Random coding fact of the day
Sep. 7th, 2005 12:50 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
One thing I love about php is the ability to go:
$result = mysql_query($query) or die();
The "or" syntax just means, "if this operation returns false, perform this other action" - used mostly for error reporting or whatever. The "die" function stops processing the page (and, yes, there's usually some useful error message inside those brackets but for the purposes of this post that's not important).
I just really enjoy telling a page to commit seppuku if it fails in its duties.
$result = mysql_query($query) or die();
The "or" syntax just means, "if this operation returns false, perform this other action" - used mostly for error reporting or whatever. The "die" function stops processing the page (and, yes, there's usually some useful error message inside those brackets but for the purposes of this post that's not important).
I just really enjoy telling a page to commit seppuku if it fails in its duties.