...

View Full Version : setting up a new database - access denied



DJ Hands3
03-23-2009, 10:36 PM
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);


So this gives me the calendar_events table created ok and everything seems fine in phpmyadmin

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


<?php
$mysql = mysql_connect("myhost", "djpromoc3", "mypassword");
mysql_select_db("calendar_events", $mysql) or die(mysql_error());
?>


All my host usernames and passwords are ok, is there something else I have missed?

Fumigator
03-24-2009, 12:28 AM
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum