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 Ivan Marsh on 06/18/07 22:35

On Mon, 18 Jun 2007 15:21:34 -0700, Computer Guy wrote:

> Hi I have recently started working with PHP and am making a neighborhood
> website. I am connecting to my Mysql database and am having difficulty
> understanding what is happening in the example on the PHP website. It
> connects fine but I do not understand the code. I do not just like to
> take other people's code so if someone can explain this to me that would
> be great.
>
> <?php
> $link = mysql_connect('localhost', 'mysql_user', 'mysql_password'); if
> (!$link) {
> die('Could not connect: ' . mysql_error());
> }
> echo 'Connected successfully';
> mysql_close($link);
> ?>
>
> I do not understand the if (!$link) part what does the ! mean and what
> is the value of link?

It's checking to see if $link has been assigned a valid connection. The
exclamation point means "not" or "false" however you'd like to turn it
into English.

 

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

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