note 43868 deleted from function.mysql-connect by betz
| From: | betz@php.net | Date: | Wed, 27 Oct 2004 20:10:01 +0000 |
| Subject: | note 43868 deleted from function.mysql-connect by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-79208@lists.php.net to get a copy of this message | ||
Note Submitter: Guillaume Beaulieu
----
There's a stupid behavior with this function when you use a blank server argument. Something
like
print mysql_connect("","","");
will print 1. So if you plan of doing an application that can connect to anything the user enter,
and wan't to be sure that the connection is properly set, this kind of check is usually the
best thing to do:
if ($link = mysql_connect($server, $user, $pass) and $server != "") {
# I'm connected !
}