At 6:35 +0000 3/11/03, J. McGregor wrote:
>I'm just learning the basics of mysql (as well as php and apache). I've
>created a simple script to test that I can connect to mysql via my
>browser and a php file.
>
><?php
>$conn = mysql_connect ("localhost", "username", "password");
>echo "$conn";
>?>
>
>I can get a connection index ok but when I try to connect and select a
>database:
>
><?php
>$conn = mysql_connect ("localhost", "username", "password");
>mysql_select_db("test",$conn);
>?>
>
>I get a message window saying "The document contained no data. Try again
>later, or contact the server's administrator".
That's because in the second case you don't print anything.
Just print "Connection successful" or something and the message will
go away.
However, you really should check the results of your function calls.
As written, you don't know whether or not they really succeeded.
>I've granted "username", "password" access to "test" to no avail.
>
>Any assistance would be greatly appreciated.
>
>Jim
--
Paul DuBois
http://www.kitebird.com/
sql, query