Not adding to db


Posted on 16th Feb 2014 07:03 pm by admin

Hi, I can't figure out why it won't add the record to the database. It's just a simple form to get name and email but when I hit submit I get the "or die" message.
Code: $Fname = $_GET['Fname'];
$eMail = $_GET['eMail'];
$submit = $_GET['submit'];
Did you know?Explore Trending and Topic pages for more stories like this.

if ($submit == 1)
{

$date = date("Y-m-d");

$sql="INSERT INTO `my_db`.`my_table` (
`usrID` ,
`usrName` ,
`usrEmail` ,
`usrDatereg`
)
VALUES (
NULL , '$Fname', '$eMail', '$date'
)";

$adduser=mysql_query($sql) or die ('Could not add you to mailing list');

$message = "Welcome to the mailing list! ";

}


It's definitely getting all the variables from the form, I tested by printing them as part of the $message variable but it just isn't adding.

Any thoughts?
No comments posted yet

Your Answer:

Login to answer
164 Like 46 Dislike
Previous forums Next forums
Other forums

error help - Dynamic Image
I've been working on making my site less cluttered in the directories and more secure lately. In an

noob cURL help
I have a pretty basic form that I need to cURL post to a file in my includes folder (includes/login.

Deleting a record php
Attempting to setup delete a record page. The below code I put together doesn't seem to work.

session checking in page load
hai all I have a web site is www.Mryas.com in this my login page is Page1.aspx its co

Shuffle between users ??
I have multiple $users in table. I need to send them $message.

I need to send the next messag

ob_ dynamic content
i was wondering about the potential to use ob to create a <div then remove it when the page

apart from cron
I need to run a php file every one hour. Is there any other solution apart from cron job?

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

Help with some dates
I have a list of dates in an array:

$mondays = array(
strtotime("October 12, 2009

Removing Title From database problem
Hi again ! i am having an issue with updating database. When i update any price of a title it remove

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