Archived

This topic is now archived and is closed to further replies.

php & mysql

This topic is 5010 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

ok i have my sql url but i can''t access it thorught the following script: $conn = mysql_connect( $sqlurl, $username, $pass) or die("could not connect/n"); What else should i try? the url var is a form that asks. Only thing i can think of is that it doesn''t work becasue i dont have http:// type of thing just akjfj.lkadfj.net. Is there a normal thing that goes before the url liek http:// for sql? Sharp Basic baby!
My Homepage | My Forums Please Register | Google | Sharp Basic - Coming summer 2004! Wanna Beta test? Clicky!

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Generally with mysql & php on a server the url string for the connect command should be "localhost" unless you''re trying to connect to a database on a different server...so I''d suggest using $sqlurl = "localhost";

You really need to be more informative about what the problem is - what are the symptoms ? I''m assuming you get a webpage back with the words "could not connect" printed on it?

Share this post


Link to post
Share on other sites
/* Connect to database */
$link = mysql_connect("localhost", "$username", "$password")
or die("Could not connect : " . mysql_error());
mysql_select_db("aaronds") or die("Could not select database");

This is what I use.
youll need to set
$username = "somename";
$password = "somepassword";

Share this post


Link to post
Share on other sites