About mysql_connect()

About mysql_connect()

am 06.02.2008 11:07:11 von Prabath Kumarasinghe

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()

am 06.02.2008 15:24:41 von Bastien Koert

--_af345971-70df-4e6b-bfc6-1aea1d3a6fc7_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


i use
=20
if (!($conn=3Dmysql_connect($host, $username, $pwd))) { notify("erro=
r connecting to DB"); die(); }else{ return $conn; }
=20
=20
in a function
=20
=20
bastien
=20
=20
> Date: Wed, 6 Feb 2008 02:07:11 -0800> From: prabath321@yahoo.com> To: php=
-db@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>=20
____________________________________________________________ _____


--_af345971-70df-4e6b-bfc6-1aea1d3a6fc7_--

RE: About mysql_connect()

am 06.02.2008 15:30:46 von Lasitha Alawatta

Pls refer http://www.php.net/mysql_connect =0A= 0D=
=0A-----Original Message----- From: Prabath Kumarasinghe [mailto=
:prabath321@yahoo.com] =0ASent: Wednesday, February 06, 2008 2:07 PM=0D=
=0ATo: php-db@lists.php.net Subject: [PHP-DB] About mysql_connect()=0D=
=0AHi All When I stop mysql database whole application wil=
l break in mysql_connect() function even without giving any error=
message.Is there are any way to put exception handling with mysql_con=
nect() function. Cheers Prabath =0 D =
________________________________________________ _______________=
_________ ____________ Looking for last minute shopping deals=3F =
=0AFind them fast with Yahoo! Search. http://tools.search.yahoo.=
com/newsearch/category.php=3Fcategory=3Dshopping -- =0APHP =
Database Mailing List (http://www.php.net/) To unsubscribe, visit: htt=
p://www.php.net/unsub.php DOTW DISCLAIMER: This=
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 any 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. This 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 in conne=
ction therewith. =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 by 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.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: About mysql_connect()

am 06.02.2008 15:45:19 von JS

Use PDO and try/catch.
I think it's much easier.

On Feb 6, 2008 7:07 PM, Prabath Kumarasinghe 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()

am 06.02.2008 15:53:16 von Stut

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
> 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()

am 07.02.2008 07:56:02 von Prabath Kumarasinghe

Hi All

It works.Thank you all, for the support.

Cheers

Prabath


--- Stut 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
>
> > 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