PHP error on MySQL insert


Posted on 16th Feb 2014 07:03 pm 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!

No comments posted yet

Your Answer:

Login to answer
99 Like 39 Dislike
Previous forums Next forums
Other forums

Convert .fdf to .pdf
I currently have a web form that uploads the form data to an .fdf file and emails it.

However

Join Query Help
Hi all,

I am having problems with the below code, which we shall call 'my first join query'!

checkbox update
I am having a brain fart right now and i cant remember how to do this. if anyone could help that wou

strptime() equivalent for php4 ?!
Greetings!

this is my first post, thank you in advance for your replies.

Well, the ti

Breaking results into week blocks
I have a set of dates (and times), which are returned from a mySQL query.

These usually span

user data not transferring to new page
I'm a PHP learner. After an index.php page, the user goes to a login.php page. Both pages seem to

Hits this week counter
I have a counter on my site that tracks hits, IP's, etc. into a mySQL database. It also includes the

PHP & Images [Resize, Crop, Save]
Hey! Well I have a little dilema, hoping I could find some guidance.

I have a CMS and on the

All possible combinations of Strings from table in PL/SQL
Hi,

I am trying to figure out how to build a list of all possible string combinations fro

Using real time in php
I'm very average at PHP and im looking to introduce time to something on my site.
Its a sports si

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash