nicg Posted March 30, 2007 Share Posted March 30, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/44974-including-a-mysql-database/ Share on other sites More sharing options...
cmgmyr Posted March 30, 2007 Share Posted March 30, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/44974-including-a-mysql-database/#findComment-218351 Share on other sites More sharing options...
Lumio Posted March 30, 2007 Share Posted March 30, 2007 wrong board Quote Link to comment https://forums.phpfreaks.com/topic/44974-including-a-mysql-database/#findComment-218353 Share on other sites More sharing options...
cmgmyr Posted March 30, 2007 Share Posted March 30, 2007 yes that too... Quote Link to comment https://forums.phpfreaks.com/topic/44974-including-a-mysql-database/#findComment-218356 Share on other sites More sharing options...
nicg Posted March 30, 2007 Author Share Posted March 30, 2007 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? Quote Link to comment https://forums.phpfreaks.com/topic/44974-including-a-mysql-database/#findComment-218358 Share on other sites More sharing options...
AndyB Posted March 31, 2007 Share Posted March 31, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/44974-including-a-mysql-database/#findComment-218465 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.