|
Posted by Andrew Clark on 06/08/05 17:57
Hello,
I am having trouble connecting to my server with mysql_connect(). I can
connect via the command line on the server and with phpMyAdmin over our
network, but not though mysql_connect(). This is my script:
<?php
$host = '192.168.100.5';
$user = 'root';
$pass = <password>;
echo '<P>Connecting...</P>';
//echo 'mysql_connect('.$host.', '.$user.', '.$pass.');';
//$link = false;
$link = mysql_connect($host, $user, $pass) or die(mysql_error());
if ($link)
{
echo '<P>Connection OK!</P>';
mysql_close($link);
}
else
{
echo '<P>Connection failed.</P>';
}
?>
The last thing I see on the page when I load this is "Connecting..." -
nothing else. It's been a while since I have worked with PHP/MySQL so
please bear with me!
Thanks,
Andrew
Navigation:
[Reply to this message]
|