![]() |
if statement success
I am pretty sure the following is true:
Code:
$result = mysqli_query( $link , $sql ); |
you mean to check if the query was a success?
it's the same except for the exclamation point. PHP Code:
|
Oh.. ha ha. Quite easy. Thanks!
|
no problem. it's weird because I learned about this way of comparison the other way around, asking how to compare a false value :P
have fun coding. |
hmmm
I ran into something today that looks a tiny bit different.
Any real difference between Code:
if($result){Code:
if(@$result){ |
Quote:
The @ symbol suppresses warning messages. |
Ah! Thats peachy. Thanks!
|
Please note the @ symbol is very slow and should not be depended above. One shouldn't have errors on a development server showing anyways.
|
Instead of using the @ supression symbol, which Enfernikus stated is slow, you should display all errors when you're developing the script.
When the script is going "live", you should then use error_reporting(0) to remove all errormsg. |
| All times are GMT. The time now is 04:27 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0