About to yank some hair, and I have very little left. Can some one look at my code, then the message I get and see what I am missing, I am at wits end, this is something that is not new to me but I am missing and I cant see it.


Included is code, message and table structure.

#######################################################
CODE:

// query to inset data into database
if ($submit) {
$bmenu=addslashes($bmenu);
$tmenu=addslashes($tmenu);
$parent=addslashes($parent);
$name=addslashes($name);
$desc=addslashes($desc);
$g_desc=addslashes($g_desc);
$sort_order=addslashes($sort_order);
$status=addslashes($status);
$image=addslashes($image);
$mb=addslashes($mb);
$calendar=addslashes($calendar);
$agiQuery="INSERT INTO group (id, bmenu, tmenu, parent, name, desc, g_desc, sort_order, status, image, mb, calendar) ";
$agiQuery.="VALUES ('', '".$bmenu."', '".$tmenu."', '".$parent."', '$name', '$desc', '$g_desc', '".$sort_order."', '".$status."', '$image', '".$mb."', '".$calendar."');";
$agiQuery.="";
print "<p>$agiQuery</p><br>\n";
$agiResult = mysql_query($agiQuery) or die("Invalid query: " . mysql_error());
if (!$agiResult){
print "<p>hey! insert failed.</p><br>\n";
}
print "<p>insert sucess!</p><br>\n";
}


#######################################################


#############################################################
MESSAGE:
INSERT INTO group (id, bmenu, tmenu, parent, name, desc, g_desc, sort_order, status, image, mb, calendar) VALUES ('', '1', '1', '0', 'FBC Administrator', 'fdhsjfds jfdash', 'jhfdjs fjdsahfjksda hfjdsha fjdskah fjdsha fdshajf dsa h', '4', '1', 'fdjshafjdash', '1', '1');



Invalid query: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'group (id, bmenu, tmenu, parent, name, desc, g_desc, sort_order
##############################################################


#####################################################
TABLE:

CREATE TABLE group (
 id int(4) NOT NULL auto_increment,
 bmenu int(1) NOT NULL default '0',
 tmenu int(1) NOT NULL default '0',
 parent int(3) NOT NULL default '0',
 name text NOT NULL,
 desc text NOT NULL,
 g_desc text NOT NULL,
 sort_order int(3) NOT NULL default '0',
 status int(1) NOT NULL default '0',
 image text NOT NULL,
 mb int(1) NOT NULL default '1',
 calendar int(1) NOT NULL default '1',
 PRIMARY KEY  (id)
) TYPE=MyISAM;


#####################################################


_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail



-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to