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
https://forums.phpfreaks.com/topic/44974-including-a-mysql-database/
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

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

Archived

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

×
×
  • 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.