You are here: Re: I am a php noob and have a quick question « PHP Programming Language « IT news, forums, messages
Re: I am a php noob and have a quick question

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация