View Single Post
Old 11-19-2008, 12:30 PM   #1 (permalink)
Normo
The Contributor
 
Normo's Avatar
 
Join Date: Oct 2008
Location: UK
Posts: 30
Thanks: 0
Normo is on a distinguished road
Default Beginners Problem

Hey,
I'm having a problem with MySQL. I am using my hosting at hostgator .com and it was all going well until I tried to create a database.
Here is my php (username and password excluded:
PHP Code:
<?php
mysql_connect
("localhost""""") or die(mysql_error());
echo 
"Connected to MySQL<br />";
mysql_query("CREATE DATABASE test") or die(mysql_error());
echo 
"Connected to Database<br />";
?>
It connects to the server but doesn't create the database, saying access is denied. I tried using MySQL Database, the MySQL software that comes with the hosting and I managed to create the database and connect to it there but it won't let me do it through PHP!

I would like a PHP solution because I'm interested in writing CMS's. Thanks.
Normo is offline  
Reply With Quote