我正在构建一个简单的表单来让用户请求供应,但在提交时它一直给我一个通用错误。我看不出我的错误在哪里...
CREATE TABLE `teacherrequests` (
`name` varchar(64) NOT NULL,
`binder` varchar(3) NOT NULL,
`binderpage` varchar(2) NOT NULL,
`binderdiv` varchar(2) NOT NULL,
`calcr` varchar(2) NOT NULL,
`chalkcolor` varchar(2) NOT NULL,
`chalkwhite` varchar(2) NOT NULL,
`chalkeraser` varchar(2) NOT NULL,
`colpencil` varchar(2) NOT NULL,
`dryerasecleaner` varchar(2) NOT NULL,
`dryeraser` varchar(2) NOT NULL,
`dryerasemarkers` varchar(2) NOT NULL,
`filefolders` varchar(2) NOT NULL,
`gluesticks` varchar(2) NOT NULL,
`hangingfile` varchar(2) NOT NULL,
`highlightermulti` varchar(2) NOT NULL,
`highlighterone` varchar(2) NOT NULL,
`holepunch3` varchar(2) NOT NULL,
`holepunch1` varchar(2) NOT NULL,
`index35` varchar(2) NOT NULL,
`index57` varchar(2) NOT NULL,
`markers` varchar(2) NOT NULL,
`papergraph` varchar(2) NOT NULL,
`paperlegal` varchar(2) NOT NULL,
`papersteno` varchar(2) NOT NULL,
`paperwhitelined` varchar(2) NOT NULL,
`paperclipsbindlg` varchar(2) NOT NULL,
`paperclipsbindmd` varchar(2) NOT NULL,
`paperclipsbindsm` varchar(2) NOT NULL,
`paperclipslg` varchar(2) NOT NULL,
`paperclipsmd` varchar(2) NOT NULL,
`paperclipssm` varchar(2) NOT NULL,
`pencil` varchar(2) NOT NULL,
`pencilsharp` varchar(2) NOT NULL,
`pensblack` varchar(2) NOT NULL,
`pensblue` varchar(2) NOT NULL,
`pensgreen` varchar(2) NOT NULL,
`pensred` varchar(2) NOT NULL,
`permanentmarker` varchar(2) NOT NULL,
`postit` varchar(2) NOT NULL,
`postitsmall` varchar(2) NOT NULL,
`stapler` varchar(2) NOT NULL,
`staples` varchar(2) NOT NULL,
`tapedbl` varchar(2) NOT NULL,
`tapemasking` varchar(2) NOT NULL,
`tapescotch` varchar(2) NOT NULL,
`tapedispenser` varchar(2) NOT NULL,
`tacks` varchar(2) NOT NULL,
`clock` varchar(2) NOT NULL,
`whiteout` varchar(2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
这是代码...
我已经对照我的表格检查了这些,它们都匹配。
$name = $_POST['name'];
$binder = $_POST['binder'];
$binderpage = $_POST['binderpage'];
$binderdiv = $_POST['binderdiv'];
$calc = $_POST['calc'];
$chalkcolor = $_POST['chalkcolor'];
$chalkwhite = $_POST['chalkwhite'];
$chalkeraser = $_POST['chalkeraser'];
$colpencil = $_POST['colpencil'];
$dryerasecleaner = $_POST['dryerasecleaner'];
$dryeraser = $_POST['dryeraser'];
$dryerasemarkers = $_POST['dryerasemarkers'];
$filefolders = $_POST['filefolders'];
$gluesticks = $_POST['gluesticks'];
$hangingfile = $_POST['hangingfile'];
$highlightermulti = $_POST['highlightermulti'];
$highlighterone = $_POST['highlighterone'];
$holepunch3 = $_POST['holepunch3'];
$holepunch1 = $_POST['holepunch1'];
$index35 = $_POST['index35'];
$index57 = $_POST['index57'];
$markers = $_POST['markers'];
$papergraph = $_POST['papergraph'];
$paperlegal = $_POST['paperlegal'];
$papersteno = $_POST['papersteno'];
$paperwhitelined = $_POST['paperwhitelined'];
$paperclipsbindlg = $_POST['paperclipsbindlg'];
$paperclipsbindmd = $_POST['paperclipsbindmd'];
$paperclipsbindsm = $_POST['paperclipsbindsm'];
$pencil = $_POST['pencil'];
$pencilsharp = $_POST['pencilsharp'];
$pensblack = $_POST['pensblack'];
$pensblue = $_POST['pensblue'];
$pensgreen = $_POST['pensgreen'];
$pensred = $_POST['pensred'];
$permanentmarker = $_POST['permanentmarker'];
$postit = $_POST['postit'];
$postitsmall = $_POST['postitsmall'];
$stapleremover = $_POST['stapleremover'];
$stapler = $_POST['stapler'];
$staples = $_POST['staples'];
$tapedbl = $_POST['tapedbl'];
$tapemasking = $_POST['tapemasking'];
$tapescotch = $_POST['tapescotch'];
$tapedispenser = $_POST['tapedispenser'];
$tacks = $_POST['tacks'];
$clock = $_POST['clock'];
$whiteout = $_POST['whiteout'];
我假设我的错误在这里,但我似乎找不到它。
// Insert data into mysql
$sql="INSERT INTO teacherrequests(name, binder, binderpage, binderdiv, calcr,
chalkcolor, chalkwhite, chalkeraser, colpencil, dryerasecleaner, dryeraser,
dryerasemarkers, filefolders, gluesticks, hangingfile, highlightermulti, highlighterone,
holepunch3, holepunch1, index35, index57, markers, papergraph, paperlegal, papersteno,
paperwhitelined, paperclipsbindlg, paperclipsbindmd, paperclipsbindsm, pencil,
pencilsharp, pensblack, pensblue, pensgreen, pensred, permanentmarker, postit,
postitsmall, stapleremover, stapler, staples, tapedbl, tapemasking, tapescotch,
tapedispenser, tacks, clock, whiteout)
VALUES('$name', '$binder', '$binderpage',
'$binderdiv', '$calc', '$chalkcolor', '$chalkwhite', '$chalkeraser', '$colpencil',
'$dryerasecleaner', '$dryeraser', '$dryerasemarkers', '$filefolders', '$gluesticks',
'$hangingfile', '$highlightermulti', '$highlighterone', '$holepunch3', '$holepunch1',
'$index35', '$index57', '$markers', '$papergraph', '$paperlegal', '$papersteno',
'$paperwhitelined', '$paperclipsbindlg', '$paperclipsbindmd', '$paperclipsbindsm',
'$pencil', '$pencilsharp', '$pensblack', '$pensblue', '$pensgreen', '$pensred',
'$permanentmarker', '$postit', '$postitsmall', '$stapleremover', '$stapler', '$staples',
'$tapedbl', '$tapemasking', '$tapescotch', '$tapedispenser', '$tacks', '$clock',
'$whiteout')";
$result=mysql_query($sql);
这是 var_dump:
ERRORstring(811) "INSERT INTO teacherrequests(name, binder, binderpage, binderdiv, calcr, chalkcolor, chalkwhite, chalkeraser, colpencil, dryerasecleaner, dryeraser, dryerasemarkers, filefolders, gluesticks, hangingfile, highlightermulti, highlighterone, holepunch3, holepunch1, index35, index57, markers, papergraph, paperlegal, papersteno, paperwhitelined, paperclipsbindlg, paperclipsbindmd, paperclipsbindsm, pencil, pencilsharp, pensblack, pensblue, pensgreen, pensred, permanentmarker, postit, postitsmall, stapleremover, stapler, staples, tapedbl, tapemasking, tapescotch, tapedispenser, tacks, clock, whiteout)VALUES('Joe Spano', '3', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '4', '', '', '', '', '', '2', '', '', '', '', '', '', '', '', '', '5', '', '', '', '', '', '', '', '')"