[prev in list] [next in list] [prev in thread] [next in thread]
List: php-general
Subject: Re: [PHP] I hate bugs...Mysqli issue
From: "Richard Lynch" <ceo () l-i-e ! com>
Date: 2007-12-31 20:30:16
Message-ID: 54991.98.193.37.55.1199133016.squirrel () www ! l-i-e ! com
[Download RAW message or body]
On Fri, December 21, 2007 10:50 am, Jason Pruim wrote:
> <?php
>
>
>
> $link = mysqli_connect($server, $username, $password, $database) ;
>
> /* check connection */
> if (mysqli_connect_errno()) {
> printf("Connect failed: %s\n", mysqli_connect_error());
> exit();
> }
>
>
>
> ?>
> It looks valid to me... as long as it's connecting... the username/
> password/database are all correct, I can log in from the command line
> with no issue....
Perhaps it is valid, when the database is up and running.
But if your DB was re-started for some reason, the link won't be there
while it's restarting will it?
You've GOT to write code to handle the $link being false instead of
marching blindly off the cliff.
You are not a lemming. :-)
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic