View Single Post
Old 06-23-2004, 10:23 AM   #4 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,505
sde is on a distinguished road
i don't know if this is gonna be correct, but i'd first try to isolate my variables:
PHP Code:
$sqlreset "CREATE TABLE '" $daydata "' ('id' tinyint(4) NOT NULL auto_increment, 'start_time' int(11) NOT NULL default '0', 'end_time' int(11) NOT NULL default '0', 'time_label' text NOT NULL, 'name' text NOT NULL, 'image' text NOT NULL, 'info_link' text NOT NULL, PRIMARY KEY ('id')) TYPE=MyISAM; INSERT INTO '" $daydata "' SELECT * FROM '".$daydata."_Template'"
then, i have never used 2 queries in 1, so i would try to seperate the last query into 2
PHP Code:
$sqlreset "CREATE TABLE '$daydata' ('id' tinyint(4) NOT NULL auto_increment, 'start_time' int(11) NOT NULL default '0', 'end_time' int(11) NOT NULL default '0', 'time_label' text NOT NULL, 'name' text NOT NULL, 'image' text NOT NULL, 'info_link' text NOT NULL, PRIMARY KEY ('id')) TYPE=MyISAM";
$sqlinsert "INSERT INTO '$daydata' SELECT * FROM '".$daydata."_Template'"
last, i didn't think that mysql supported sub-queries, but i guess i'm wrong if it works in phpmyadmin.
__________________
Mike
sde is offline   Reply With Quote