Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
03-23-2009, 11:36 PM #1
- Join Date
- Feb 2009
- Thanked 0 Times in 0 Posts
setting up a new database - access denied
I'm setting up a database and have never done so before so I'l talk you through what I have done, in phpmyadmin I exported this text file to create the database as below
CREATE TABLE calendar_events ( id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, event_title VARCHAR (25), event_shortdesc VARCHAR (255), event_start DATETIME);
But when I go to connect to the database through a php script I get
Access denied for user 'djpromoc3'@'%' to database 'calendar_events'
the php is below
$mysql = mysql_connect("myhost", "djpromoc3", "mypassword");
mysql_select_db("calendar_events", $mysql) or die(mysql_error());
03-24-2009, 01:28 AM #2
- Join Date
- Dec 2005
- Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
- Thanked 637 Times in 625 Posts
You are creating a table calendar_events, but then you are trying to select a database named calendar_events... a table is not the same thing as a database.