2016-01-18 21 views
0

Column count doesn't match value count at row 1我得到这个错误:列数并不在行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

查询缺少值ipt8。发生此错误的原因是插入的值与表中指定的字段数不匹配。

+0

感谢您的帮助... – amirul

相关问题