HELP about pull hair on this INSERT

This is a discussion on HELP about pull hair on this INSERT within the PHP General forums, part of the PHP Programming Forums category; About to yank some hair, and I have very little left. Can some one look at my code, then the ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-10-2003
Didier McGillis
 
Posts: n/a
Default HELP about pull hair on this INSERT


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

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 02:36 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0