PHP error on MySQL insert

Posted on 16th Feb 2014 by admin

I'm sure it's the simplest of issues, but I can't recall why this isn't working.

Code: [Select]<?php
//setup our insert command
$sql = "INSERT INTO `my_db_name`.`my_table_name` (`id`, `first_name`, `last_name`, `email`, `birthday_month`, `birthday_day`, `phn1`, `phn2`, `phn3`, `ip_address`, `date_entered`) VALUES (NULL, $_POST['fName'], $_POST['lName'], $_POST['email'], $_POST['birthdayMonth'], $_POST['birthdayDay'], $_POST['phn1'], $_POST['phn2'], $_POST['phn3'], $_SERVER['REMOTE_ADDR'], date(YYYY-MM-DD HH:mm:SS));";

//do insert into MySQL
mysql_query($sql);
?>
The error I'm seeing is this...

Code: [Select]Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in handler_file.php
Any help is appreciated!

Other forums