Jump to content

Including a mysql database


nicg

Recommended Posts

I have created a mysql database using phpmyadmin but am having difficulty loading the database into a php script. I think I know all parameters of a php include statement but I don't know exactly where my database is stored and I'm not sure what 'password' means and where to find it.

 

Any help (other than directing me to material I've already read) would be appreciated.

Link to comment
Share on other sites

mysql_connect("localhost", "username", "password") or die("Could not connect to mysql");
mysql_select_db("database") or die("Could not connect to database");

 

this allows you to connect to a database. You get your username and password when you set your mysql and database up.

 

hope this helps you out

Link to comment
Share on other sites

Whoops and thanks.

 

Just one more thing though. Is there any way to check what my username and password are as I can't remember. phpmyadmin says root@localhost but I'm not sure of the password. Is there any way to check?

Link to comment
Share on other sites

Whoops and thanks.

 

Just one more thing though. Is there any way to check what my username and password are as I can't remember. phpmyadmin says root@localhost but I'm not sure of the password. Is there any way to check?

 

Easy.

 

Plan 'A': Just refer to the piece of paper where you wrote it down.

 

Plan 'B': Go to your server control panel and create a new username/password (and write it down), and new database, etc. and start over

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.