List:General Discussion« Previous MessageNext Message »
From:Peter Brawley Date:March 11 2006 5:53pm
Subject:Re: mysql_commect or die
View as plain text  
fbsd_user wrote:
>    mysql_connect("localhost","root") 
>         or die("Unable to connect to MySQL server");
>
>   $err mysql_connect("localhost","root");
>   if ($err != 0) {
>
> Under what conditions will the die clause be taken.
>
> What is in $err  if there is a error?
>
> Are these 2 statements basically doing the same thing?
>   
mysql_connect() returns a PHP connection resource on success, FALSE on 
failure; or ... executes if the func returns FALSE. To see what the 
error is, try ... or exit( mysql_error() ). Best practice is to build 
your own generic error handler around this functionality.

PB
>  
>  
>
>   


-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 268.2.1/279 - Release Date: 3/10/2006

Thread
mysql_commect or diefbsd_user11 Mar
  • RE: mysql_commect or dieIng. Edwin Cruz11 Mar
  • Re: mysql_commect or diePeter Brawley11 Mar