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'];

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?

164 Like 46 Dislike
Previous php-forum Next php-forum
Other php-forum

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

I need to send the next messag

Formatting echo from database
So I have a database that stores First and last names, then echos them back to a website, as of now

How to know if online site made with PHP
Hello,
I see some sites that does not display extensions at all , for example:

www.site.co

$_GET problem
Hi all,

Have a bit of a problem with a little piece of code, I am not sure if this should be

Displaying returned XML in another PHP page
I have an online payment form that will return XML given if a payment is successful or declines. I

Variables and Include
Code: [Select]<?php

$header = $_COOKIE['mss']['header'];
$body = $_COOKIE['mss']['b

How to secure my login data to my database?
Hi there,

It may be a stupid question but I don't know how to secure my login data to my data

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

Showing selected item at top of list
Hi,

I've got a list of names which i am fetching from database like this:
$qry = db_query

I am stumped
OK. Here is what I am trying to do. I have the conditions set, and if the conditions are met, I want

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