RE: [PHP] Re: PHP with MySQL
| From: | .ben | Date: | Fri, 03 May 2002 10:27:57 +0000 |
| Subject: | RE: [PHP] Re: PHP with MySQL | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-95853@lists.php.net to get a copy of this message | ||
Just out of interest, what's the standard/best/tried&tested method for
handling errors in relation to connecting to DB's? i.e. how to check that
the connection was a success, and if not then display why.
any pointers appreciated.
.b
> -----Original Message-----
> From: Mike Eheler [mailto:meheler@canada.com]
> Sent: 03 May 2002 02:28
> To: php-general@lists.php.net
> Subject: [PHP] Re: PHP with MySQL
>
>
> Typically it's done like:
>
> $db = mysql_connect('localhost','username','password');
>
> The MySQL database detects what host you're connecting from, and appends
> that to your username. I'm not sure if it's possible to specify an
> alternate host.
>
> So if both PHP and MySQL are on the same machine, and you connect to the
> MySQL server as 'username', MySQL will see you as 'username@localhost'.
>
> Mike
>
>
> Paras Mukadam wrote:
> > Hi Gurus,
> > one MySQL - PHP query : while granting permissions to particular user in
> > MySQL, the administrator has to give username@machine_address
> !! Then how
> > can we connect to MySQL through PHP only by passing "username"
> as one of the
> > arguments to mysql_connect() ?
> >
> > Thanks.
> > Paras.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>