Keep getting this mysql error:
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 '', '2', '3', '1', '4', 'd', '5')' at line 1
My code is:
$sql = "INSERT INTO cmodules(name, code, groupa, groupb, groupc, groupd, wgroupa, wgroupb, ygroup, occ, lectw, priority) VALUES ('$name', '$code', '$gra', '$grb', '$grc', $grd', '$wga', '$wgb', '$yg', '4', '$leg', '$count')";
mysql_query($sql);
echo mysql_error();
the fields priority and occ are INTS in the table.
Getting the info from a form in this way:
//main info
$code = $_POST['code'];
$name = $_POST['name'];
$occ = $_POST['occr'];
$yg = $_POST['year'];
//user defined
$gra = $_POST['ga'];
$grb = $_POST['gb'];
$grc = $_POST['gc'];
$grd = $_POST['gd'];
//weak constraints
$wga = $_POST['day'];
$wgb = $_POST['week'];
$leg = $_POST['lg'];
Does anyone have any ideas what im doing wrong?
by: _agx_Posted on 2007-05-09 at 21:09:33ID: 19062689
You're missing a single quote before: $grd'