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

Career Change into SAP
Hai
I am sajesh ,did my diploma in Mechatronics i have a 4 years of experience in

mails going in spam??
The mails I sent to folks in my database using mail(function) are going in spam??

Any idea ho

replacements
I have a variable in my PHP script like

ASSFDDDDDDDDDDDDDASDDDDDDDDARYTRHKKHHHHHHHHHHH and p

help connecting a form to php and then emailing the form
Ok. So, I made a form, and I need help to where when submitted, I get an email with the submitted de

Need some ideas as to how to go about sorting this array...
Here's how the array's are created..

Code: <?php
while ($x = readdir($dp)) {

function to return url
Hi,

Can you guys help me giving a function that takes all the contents in a particular field

tell csv import script to ignore blank rows?
Hi i have the below script but i get an error if a row is blank ie a return in the csv file at the e

storing video files into mysql in php
hi

i have my video files in my folder ,
i have to store the path of the videos into db an

How to pass parameter to tag query?
Hi,
I want to get the value of a tag at a specific time (like 10/27/09 15:29:59), I need to giv

URL Rewrite issue
Im created a series of Rewrites and on page checks to make sure the correct url is being called. But

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