use the addslashes out side of your string...it's a function.
use single quotes in your $sql definetion.
if id is an auto_increment column, just leave it out.
and, last but not least, read the manual!
$code = addslashes($code);
$sql = "INSERT INTO $table_name (fname, lname, email, title, code_desc, code_notes, code, date_added) values ('$fname','$lname','$email','$title','$code_desc','$code_notes','$code','$date_added')";
---John Holmes...