Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: PHPDev: How do I access MySQL?
01-06-2007, 03:13 AM #1
- Join Date
- Jan 2007
- Thanked 0 Times in 0 Posts
PHPDev: How do I access MySQL?
I have phpdev working fine for php, but I am trying to set up a database now, and it seems like I remember setting up a password back when I installed it, but I have no idea what that was now.
How do I find out what it was, and what the other information is?
01-06-2007, 08:32 PM #2
- Join Date
- Jul 2002
- Vancouver, BC Canada
- Thanked 100 Times in 100 Posts
You don't need a password or user, leave those blank. Launch phpdev and click on start_here.htm > localhost/phpmyadmin to create your new database. To connect to the database I use this php code, the only change it needs is the DB_NAME, canada would be changed to your database name.
When you upload your code to a server you will have to enter the DB_USER and DB_PASSWORD, which you will get when you setup the database, so make sure you write those down. phpdev has PHP Version 4.2.3, you might run into some problems with newer code.PHP Code:
define ('DB_USER', '');
define ('DB_PASSWORD', '');
define ('DB_HOST', 'localhost');
define ('DB_NAME', 'canada');
$dbc = mysql_connect (DB_HOST, DB_USER, DB_PASSWORD);
Last edited by Len Whistler; 01-06-2007 at 08:35 PM.