I just installed MySQL on my IIS 6.0 (Windows 2003 Server).
I am just trying certain operations to make sure MySQL server is working properly.
when I try to use the mysql_connect() function it works from command line on the server computer but not from a an http call. For example (code from test.php):
<TITLE> This is a Drag </TITLE>
$a = 0;
mysql_connect('localhost', 'user', 'passy');
mysql_select_db('wordpress') or die(mysql_error());
mysql_query("CREATE TABLE testerrrr(id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), name VARCHAR(30), age INT)")
from command line:
<title> this is a drag </title>
(AND the table is created)
(no table created)
This means that the test.php is dying when i Try to call the mysql_connect funtion.
I have tried using 127.0.0.1 for localhost... localhost:port... and many other variations. Now remember I am a newbie and I might be doing something very simple wrong. It might not even be possible. Anyhow, I appreciate the input everyone!
1 reply to this topic
Posted 10 August 2006 - 06:50 AM
Try to put
or die(mysql_error())after the connect function and see if an error is returned. Another problem might be that you ran it from command line first, that created the table, then tried on the server, but then it can't create it because it already exists.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users