View Single Post
  #2 (permalink)  
Old 04-18-06, 10:28 PM
Skeleton Man Skeleton Man is offline
Community Liaison
 
Join Date: Jun 2003
Location: Australia
Posts: 406
Thanks: 0
Thanked 0 Times in 0 Posts
You need to put backticks (`) around the table name (it's a good idea to use them all the time even if the name doesn't have spaces).

PHP Code:

$query"CREATE TABLE `$tablename` (

         time datetime NOT NULL default '0000-00-00 00:00:00', 
         first_name varchar(30) NOT NULL, 
         last_name varchar(30) NOT NULL, 
         email varchar(50) NOT NULL, PRIMARY KEY (time))"

The backtick on most keyboards is at the top left, next to the number 1 (it will have ` and ~ on it). Other than that it should be fine.. your MySQL syntax is fine.
__________________
Chris (aka Skeleton Man)
ProgrammingTalk's Perl/PHP Moderator !

Last edited by Skeleton Man; 04-18-06 at 10:33 PM.
Reply With Quote