[thelist] PHP to mySQL connect...
Peter Brunone (EasyListBox.com)
peter at easylistbox.com
Fri Jul 23 21:51:06 CDT 2004
Hi Walter,
Try mysql_connect instead of mysql_pconnect and see if that
works.
Cheers,
Peter
-----Original Message-----
From: thelist-bounces at lists.evolt.org On Behalf Of jsWalter
I have 2 machines, a server (Win NT server) and a workstation (Win XP
Pro).
On the server I have PHP, mySQL, Apache, Perl, etc.
If I run this command from the prompt...
G> mysql -h db.torres.ws -u user
It connects fine.
If I do this from PHP...
$db_user = "user";
$db_pass = "";
$db_name = "myDB";
$db_host = 'db.torres.ws'; // '192.168.1.10'
mysql_pconnect($db_host, $db_user, $db_pass)
or die("Unable to connect to SQL server");
mysql_select_db($db_name)
or die("Unable to select database");
I get this...
Warning: mysql_pconnect(): Unknown MySQL Server Host
'db.torres.ws' (11001) in G:\home\php\htdocs\db.php
on line 12
But if I use the IP, it connects just fine. If I use 'localhost', it
works.
BTW: db.torres.ws is in the HOSTS file on both machines.
Anyone have any ideas?
Thanks
Walter
More information about the thelist
mailing list