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

Need help urgant
why down my code ony return one item instead of all the items selected.

$arr = array($date,$

Reg Ex
Im trying to search for the string: srv_9 (Dead ???)

I thought to use preg_match, however I d

Must be a string? Huh, what? HELP?
with the following script, I get
Fatal error: Property name must be a string in /home/content/e/

Accessing Infotype data in dialog program
Hi All
In Dialog programs attributes I didn't see any logical database field. How can I access

cURL and Sessions
Ohai.

So, I'm trying to cURL a bunch of things off of a page, and put them into a session. I'

Significance of BPM
Hi Experts,
I am a novice in BPM , I just want to know how BPM as permenant department is

Display thumbnails as square while retaining aspect ratio
I am trying to figure out a way to make an image display as a square, for example 80x80 pixels, when

help finding hacking loopholes
i was attacked by a redirect php injection

my pc is clean of viruses

so i figure that

How to get all server headers like Live http Headers does
Hey all, like many of you I use the Firefox addon "Live http Headers". I'm trying to write

modifying query string with no page refresh
Hi everybody,
I've tried to get info about my problem all over the internet but i didn't find out

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