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?

No comments posted yet

Your Answer:

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

Suggestions for Functional module
Hello experts,
I Have done B.Sc(Mathematics) and MCA & have learnt SAP/ABAP but do n

Convert Binary String to Decimal
Trying to Get:
Decimal: 305419896

Out of:
Binary String: xV4

can i optmize image to 50% quality before uploading 2 server
Hi there

i have jus written a php program to upload and display images but when i try to uplo

How would I do "Users not logged in since *** delete them"
I know how I would set this up, and delete the user roughly.
I'll create a table called "Use

Javascript using window.location seems to lose state
Not sure what forum so let me know if I'm in the wrong place. I have a main window with a ajax grid

Strange cookie problem. setcookie dependant on where user was directed from?
Hello,

I have a website that sets a cookie when a user visits the website. The cookie holds a

TinyMCE / Ajax Postback Problem
Hiya all,

I have a page which loads the TinyMCE editor. On the postback I obviously want to f

Procedural to OOP
ohn Kleijn said that to avoid writing "crappy code", we should learn OOP and common OO pri

Bandwidth monitoring?
Hi guys,

I need a little information I have written a php app and I occurred to that I need

Syntax Help
I'm trying to make a form that edits a php file which contains config settings. I'm using strings t

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