Jump to content

about mysql_select_db


qasaa

Recommended Posts

What database name will "mysql_select_db" function use?

It will use the empty string and return FALSE if it doesn't find the DB.  Are you sure that it's not resigning $db somewhere?

Link to comment
Share on other sites

go into phpmyadmin or whatever you use and see what the database name is then do this:

 

mysql_connect("hostname", "user", "pass") or die("could not connect");
mysql_select_db("database_name") or die("could not connect to the database");

 

if your using a local server the connect normally looks like this:

 

mysql_connect("localhost", "root", "");

Link to comment
Share on other sites

That code is telling you to provide YOUR credentials, hence the comments:

$host="localhost"; // Host name
$username=""; // Mysql username
$password=""; // Mysql password
$db_name=""; // Database name 

Link to comment
Share on other sites

thanks for your kind help.

Sure, if you're still having trouble with the tutorial/script just come back and ask.  You can mark threads resolved (bottom right button, I believe).

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.