|
Posted by shubeer on 06/18/07 22:42
It's pretty simple. The PHP manual says this about the mysql_connect
function:
"Returns a MySQL link identifier on success, or FALSE on failure."
So, if the connection to the database does not succeeds then the
condition !$link will equate to TRUE because the ! means NOT i.e. NOT
FALSE meaning TRUE. If you had to translate this to English
therefore, the test !$link tests whether the database connection has
been made and if not, then it will run the code:
die('Could not connect: ' . mysql_error());
which causes the script to terminate giving an appropriate error
message.
Hope this helps.
Shubeer
Navigation:
[Reply to this message]
|