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

passing data from one page to another
hey guys
i have the follwoing code to get information from one page and place on another:

Problem with PHP code- simple contact form
Hi Folks,
I'm relativily new to PHP; I know HTML and CSS stuff but I have a problem- I have a co

Online Event Ticket Sales
Has anyone wrote a script for online tickets sales?

I have been googling and found lots of th

New to Arrays
Hi I am new to PHP (a week and a half now) and I am just beginning to read about arrays. I understan

mysql_real_escape_string
Let me preface this that I am very much a PHP noob, but I have some SQL training (not necessarily My

need good snippet manager
Hi. as i am coding and learning more, it is becoming difficult to manage code snippets. how you mana

How to convert this array to string
I am having problems converting this array to a string
using print_r($val[1]); I get:
Code: [

PHP Code / Script To check weather the given email exists in a domain
Hi,

I want to implement the following in my web page

in sign up we will ask to enter u

ereg_replace()
Basically what i need to do is

$title = "This Suck's"

$striped = ereg_repl

PHP XML extraction text
I would like to extract an xml text and have that text directly echo(print) out on my web page. Her

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