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?
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?