列数与第1行的值计数不匹配
这是代码:
/* execute SQL INSERT command */
$sql2 = "INSERT INTO form
(datesubmit,uitmid, idnumber, roomnumber, collegename, studname, phone, part,
program, faculty, cgpa, position1, position2, email, vehicle,
advisorname, hpnumberadvisor, emailadvisor, academic, oku,
date, sex, religion, address, fathername, fatherhp,
salfather, mothername, motherhp, salmother, namesibling1, ipt1, namesibling2,
ipt2, namesibling3, ipt3, namesibling4, ipt4, namesibling5, ipt5, namesibling6, ipt6, namesibling7, ipt7,
namesibling8, ipt8, namesibling9, ipt9, namesibling10, ipt10)
VALUES (now(),'" . $uitmid . "', '" . $idnumber . "', '" . $roomnumber . "', '" . $collegename . "',
'" . $studname . "', '" . $phone . "', '" . $part . "', '" . $program . "', '" . $faculty . "',
'" . $cgpa . "', '" . $position1 . "', '" . $position2 . "', '" . $email . "', '" . $vehicle . "',
'" . $advisorname . "', '" . $hpnumberadvisor . "', '" . $emailadvisor . "', '" . $academic . "', '" . $oku . "',
'" . $date . "', '" . $sex . "',
'" . $religion . "', '" . $address . "', '" . $fathername . "', '" . $fatherhp . "', '" . $salfather . "', '" . $mothername . "',
'" . $motherhp . "', '" . $salmother . "', '" . $namesibling1 . "', '" . $ipt1 . "',
'" . $namesibling2 . "', '" . $ipt2 . "', '" . $namesibling3 . "', '" . $ipt3 . "',
'" . $namesibling4 . "', '" . $ipt4 . "', '" . $namesibling5 . "','" . $ipt5 . "' ,'" . $namesibling6 . "' ,'" . $ipt6 . "',
'" . $namesibling7 . "' ,'" . $ipt7 . "' ,'" . $namesibling8 . "' ,'" . $namesibling9 . "' ,'" . $ipt9 . "' ,'" . $namesibling10 . "' ,'" . $ipt10 . "')";
mysql_query($sql2) or die ("Error: " . mysql_error());
答案 0 :(得分:0)
查询缺少ipt8的值。发生错误是因为插入的值与表中指定的字段数不匹配。