Page 1 of 1
can't connect to mysql while offline
Posted: Sat Jun 21, 2003 1:25 am
by paul_r
hello! why can't i connect to my mysql database server while i'm offline? But when i'm connected to the internet, i'm able to connect to it. I use COMPUTERNAME in mysql_connect() method. I have already tried localhost and 127.0.0.1. i also tried appeding the port, 3306. Still nothing when offline. i'm using iis under windows xp pro. Pls help. thanks!
Posted: Sat Jun 21, 2003 5:33 am
by twigletmac
What kind of error message do you get if you try and connect when you're offline?
Mac
Posted: Sat Jun 21, 2003 6:09 am
by paul_r
the error i get when i'm offline:
Warning: mysql_connect(): Access denied for user: 'rivera@127.0.0.1' (Using password: YES) in c:\inetpub\wwwroot\mysql.php on line 15
rivera
But my script runs perfectly fine when i'm online. Here's my script:
<?php
$username="rivera";
$password="rivera";
$database="myfirstdatabase";
mysql_connect("PAUL",$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM MyFirstTable";
$result=mysql_query($query);
$first=mysql_result($result,0,"name");
printf( $first );
?>
i have a database named myfirstdatabase with a table named myfirsttable. myfirsttable has two columns: name and idnum. thanks!