View Single Post
  #5 (permalink)  
Old 07-30-2007, 12:45 AM
molotov molotov is offline
Novice
Join Date: Jul 2007
Posts: 37
iTrader: (0)
molotov is on a distinguished road
Um, you're not selecting the database to use. Add this after the connection, but before your SQL:

PHP Code:
$db 'your_db';
mysql_select_db($db); 
Like this:

PHP Code:
$username 'username';         // mySQL username
$password 'password';     // mySQL password
$host 'localhost';    // mySQL host

// this is new
$db 'your_db';        // mySQL db name

$link mysql_connect($host,$username,$password) or die(mysql_error());

// this is also new
mysql_select_db($db);

$query 'CREATE TABLE mycms ('.
         
'id INT NOT NULL AUTO_INCREMENT KEY'.
         
'username VARCHAR(10) NOT NULL, '.
         
'password VARCHAR(10) NOT NULL)'
         
$result mysql_query($query); 
Edit: Also, I didn't look through the rest of your mySQL, but once you have the DB selected, your mysql_error() output should be more telling if you still have errors.

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!

Last edited by molotov : 07-30-2007 at 12:48 AM.
Reply With Quote