php - Stuck with unknown column in field MySQL -
i maintain getting error
unknown column 'hello' in 'field list'
when execute code
$sql = "insert installs (date,addedby,customer,reg,vehmake,vehmodel,colour,mileage,location,tracker,serial,sim,extr as,satnav,input1,input2,output,comments) values (" . $date . ", " . $addedby . ", " . $customer . ", " . $reg . ", " . $vehmake . ", " . $vehmodel . ", " . $colour . ", " . $mileage . ", " . $location . ", " . $tracker . ", " . $serial . ", " . $sim . ", " . $extras . ", " . $satnav . ", " . $input1 . ", " . $input2 . ", " . $output . ", " . $comments . ")"; $result = $connect->query($sql) or die($connect->error);
replace this
(' . "hello" . ', ' . 2 . ', ' . 3 . ', ' . 4 . ', ' . 4 . ', ' . 5 . ', ' . 6 . ', ' . 7 . ', ' . 8 . ', ' . 9 . ', ' . 10 . ', ' . 11 . ', ' . 12 . ', ' . 13 . ', ' . 14 . ', ' . 15 . ', ' . 16 . ', ' . 17 . ')';
by
("hello", 2 ,3, 4,4,5,6,7,8,9,10,11,12, 13,14,15,16,17)';
edit:
replace this
(" . $date . ", " . $addedby . ",..........
by
('$date', '$addedby',...........
or this
('" . $date . "', '" . $addedby . "',..........
php mysql mysqli
No comments:
Post a Comment