I have two scripts which insert a new line into my SQL database. One works, and the other doesn't. They both look the same (but for the different data) but one doesn't work. I can not figure out what I am doing wrong.
Disclosure: I am self taught and have not taken any programming courses except for a pascal class several years ago.
This one works: include('db.php');
mysql_query("INSERT INTO leadprofile (first_name, last_name, home_phone, mobile_phone, work_phone, work_phone_ext, email_address, description, fk_source) VALUES ('$_POST[first_name]','$_POST[last_name]','$_POST[home_phone]','$_POST[mobile_phone]','$_POST[work_phone]','$_POST[work_phone_ext]','$_POST[email_address]','$_POST[description]','$_POST[fk_source]')");
mysql_close($con);
This one does not work. The page loads, but no values are inserted into the table:
include('db.php');
mysql_query("INSERT INTO tasks (fk_lead_id, task_type, task_detail, due_date) VALUES ('$_POST[fk_lead_id]',('$_POST[task_type]','$_POST[task_detail]','$_POST[due_date]')");
mysql_close($con);
Both are referencing the same db.php file which loads the database only. I appreciate any help and hope it is something crazy simple. I have confirmed the table name and column names are all correct.
O'Connor?); SQL injection risks?