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

Reply via email to