inserting data
Hi
I am trying to pick-up the response when a user ticks a checkbox called – version_id_ac. And or
A user has the option to select either one or both checkboxes in a form and I am trying to store which options they selected in to a mysql table called user_version with a column in the table called version_id
Please see the code below I don’t get anything inserted, please would someone tell me where I am going wrong with my syntax
if ('$data[version_id_ac] == true'); {
$sql_insert = "INSERT into `user_version`
(`version_id`,`id`)
VALUES
('$data[version_id]','$user_id')
"; }
mysql_query($sql_insert,$link) or die("Insertion Failed:" . mysql_error());
$user_id = mysql_insert_id($link);
if ('$data[version_id_dc] = true') {
$sql_insert = "INSERT into `user_version`
(`version_id`,`id`)
VALUES
('$data[version_id_DC]','$user_id')
"; }