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

CU&UC guide
Hi Gurus,

can anybody provide me the link for CU&UC upgrade guide

Thanks i

Binding 2 UDP sockets on same port, connected to different destinations, 1 receives
Hello,
My application wants to send/recv data to 2 different UDP ports on a remote computer, us

Hom to make one url to open together with another url
I have a chat, which i want to be opened, as soon as the users login to the site. As it is now, when

Remore client postprocessing phase getting dump SAPSQL_ARRAY_INSERT_DUPREC
Hello Expects,I have started remore client copy. Data was copied successfully. but while running pos

how can i expire the submitted page using session.
hi,
i'm new to php world.
i'm using "post" method.
when i submit it,data goes to

Place specific image in html page when specific name is typed.
Hello,

Fairly new to PHP and was curious if someone might know how to solve a fairly simple r

Most basic form question ever?
Hello,

I want to use this snippet to make sure the fields in a form are ok before processing

FFmpeg Images 2 Video conversion problem ??
I got folder full of images , number of images = 600 , I want to make a video which plays one image

License Issue - service type user
Hi,

I would like to understand the following issue regarding sap license.
I wish to

some questions
Hello,

I am looking for the answers for following questions:

1) Does PHP support overl

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