About mysql_connect()
Hi All
When I stop mysql database whole application will
break in mysql_connect() function even without giving
any error message.Is there are any way to put
exception handling with mysql_connect() function.
Cheers
Prabath
____________________________________________________________ ________________________
Looking for last minute shopping deals?
Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?categor y=shopping
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
RE: About mysql_connect()
--_af345971-70df-4e6b-bfc6-1aea1d3a6fc7_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
i use
if (!($conn=3Dmysql_connect($host, $username, $pwd))) { notify("erro=
r connecting to DB"); die(); }else{ return $conn; }
in a function
bastien
> Date: Wed, 6 Feb 2008 02:07:11 -0800> From: prabath321 [at] yahoo.com> To: php=
-db [at] lists.php.net> Subject: [PHP-DB] About mysql_connect()> > Hi All> > Whe=
n I stop mysql database whole application will> break in mysql_connect() fu=
nction even without giving> any error message.Is there are any way to put> =
exception handling with mysql_connect() function.> > Cheers> > Prabath> > >=
> > ____________________________________________________________ __________=
______________> Looking for last minute shopping deals? > Find them fast wi=
th Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?cate=
gory=3Dshopping> > -- > PHP Database Mailing List (http://www.php.net/)> To=
unsubscribe, visit: http://www.php.net/unsub.php>
____________________________________________________________ _____
--_af345971-70df-4e6b-bfc6-1aea1d3a6fc7_--
RE: About mysql_connect()
=0D=0APls refer http://www.php.net/mysql_connect =0D=0A=0D=0A=0D=0A=0D=0A= 0D=
=0A=0D=0A-----Original Message-----=0D=0AFrom: Prabath Kumarasinghe [mailto=
:prabath321 [at] yahoo.com] =0D=0ASent: Wednesday, February 06, 2008 2:07 PM=0D=
=0ATo: php-db [at] lists.php.net=0D=0ASubject: [PHP-DB] About mysql_connect()=0D=
=0A=0D=0AHi All=0D=0A=0D=0AWhen I stop mysql database whole application wil=
l=0D=0Abreak in mysql_connect() function even without giving=0D=0Aany error=
message.Is there are any way to put=0D=0Aexception handling with mysql_con=
nect() function.=0D=0A=0D=0ACheers=0D=0A=0D=0APrabath=0D=0A=0D=0A=0 D=0A=0D=0A=0D=
=0A =0D=0A________________________________________________ _______________=
_________=0D=0A____________=0D=0ALooking for last minute shopping deals=3F =
=0D=0AFind them fast with Yahoo! Search.=0D=0Ahttp://tools.search.yahoo.=
com/newsearch/category.php=3Fcategory=3Dshopping=0D=0A=0D=0A -- =0D=0APHP =
Database Mailing List (http://www.php.net/)=0D=0ATo unsubscribe, visit: htt=
p://www.php.net/unsub.php=0D=0A=0D=0A=0D=0ADOTW DISCLAIMER:=0D=0A=0D=0AThis=
e-mail and any attachments are strictly confidential and intended for the =
addressee only. If you are not the named addressee you must not disclose, c=
opy or take=0D=0Aany action in reliance of this transmission and you should=
notify us as soon as possible. If you have received it in error, please co=
ntact the message sender immediately.=0D=0AThis e-mail and any attachments =
are believed to be free from viruses but it is your responsibility to carry=
out all necessary virus checks and DOTW accepts no liability=0D=0Ain conne=
ction therewith. =0D=0A=0D=0AThis e-mail and all other electronic (includ=
ing voice) communications from the sender's company are for informational p=
urposes only. No such communication is intended=0D=0Aby the sender to cons=
titute either an electronic record or an electronic signature or to constit=
ute any agreement by the sender to conduct a transaction by electronic mean=
s.=0D=0A
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: About mysql_connect()
Use PDO and try/catch.
I think it's much easier.
On Feb 6, 2008 7:07 PM, Prabath Kumarasinghe <prabath321 [at] yahoo.com> wrote:
> Hi All
>
> When I stop mysql database whole application will
> break in mysql_connect() function even without giving
> any error message.Is there are any way to put
> exception handling with mysql_connect() function.
>
> Cheers
>
> Prabath
>
>
>
>
> ____________________________________________________________ ________________________
> Looking for last minute shopping deals?
> Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?categor y=shopping
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: About mysql_connect()
On 6 Feb 2008, at 14:45, js wrote:
> Use PDO and try/catch.
> I think it's much easier.
Easier than checking the return value for FALSE?
OP: The manual is your friend, it tells you exactly how to detect
failures from any function.
http://php.net/mysql_connect
-Stut
--
http://stut.net/
> On Feb 6, 2008 7:07 PM, Prabath Kumarasinghe <prabath321 [at] yahoo.com>
> wrote:
>> Hi All
>>
>> When I stop mysql database whole application will
>> break in mysql_connect() function even without giving
>> any error message.Is there are any way to put
>> exception handling with mysql_connect() function.
>>
>> Cheers
>>
>> Prabath
>>
>>
>>
>>
>>
>> ____________________________________________________________ ________________________
>> Looking for last minute shopping deals?
>> Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?categor y=shopping
>>
>> --
>> PHP Database Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: About mysql_connect()
Hi All
It works.Thank you all, for the support.
Cheers
Prabath
--- Stut <stuttle [at] gmail.com> wrote:
> On 6 Feb 2008, at 14:45, js wrote:
> > Use PDO and try/catch.
> > I think it's much easier.
>
> Easier than checking the return value for FALSE?
>
> OP: The manual is your friend, it tells you exactly
> how to detect
> failures from any function.
> http://php.net/mysql_connect
>
> -Stut
>
> --
> http://stut.net/
>
> > On Feb 6, 2008 7:07 PM, Prabath Kumarasinghe
> <prabath321 [at] yahoo.com>
> > wrote:
> >> Hi All
> >>
> >> When I stop mysql database whole application will
> >> break in mysql_connect() function even without
> giving
> >> any error message.Is there are any way to put
> >> exception handling with mysql_connect() function.
> >>
> >> Cheers
> >>
> >> Prabath
> >>
> >>
> >>
> >>
> >>
> >>
>
____________________________________________________________ ________________________
> >> Looking for last minute shopping deals?
> >> Find them fast with Yahoo! Search.
>
http://tools.search.yahoo.com/newsearch/category.php?categor y=shopping
> >>
> >> --
> >> PHP Database Mailing List (http://www.php.net/)
> >> To unsubscribe, visit:
> http://www.php.net/unsub.php
> >>
> >>
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, visit:
> http://www.php.net/unsub.php
> >
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
____________________________________________________________ ________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php