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
Did you know?Explore Trending and Topic pages for more stories like this.
$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

Pulling out some result data from MYSQL
Hey Guys,

I've built a PHP page that has a for just imagine something like registration form

Little problem with form insertion in MySQL, Please help!!!
Hi!,

I'm a little bit new with php and I have a little issue here. I created a webform to ins

mail with attachment problems
Hi. I have the following code:
Code: else if(file_exists("site".$timp.".zip")

My query is being run with no results.
I have this.

Code: function DropUser($duser_id, $user_email, $user_username) {

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

Pop-up Banner
Hello Friends,I need to use banner in our client site.Example: www.example.com if i enter this site

OPINIONS WANTED
This is my login page code, and I want your opinion on it please!

Code: // Login ~ CHECKS

HTML form problem
Ive made a form to that i want to send to my email via PHP. but when it send only the name's etc sen

I need help on this PHP code
Hi everybody, I made some kind of mistake while editing the code below. As you see, at the 3 row my

LIMIT $start, 10... how to pass last value queried into next page with GET??
Ok I know how to display the first or last 10 results of a query...

$result = mysql_query(&q

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