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

Linkage between two scripts
Okay say I have this for a link in a script:

Code: <li><a href="#&q

Help with translating C code into assembler code
Hi im doing a project that moves a robot around a maze avoiding walls and need some help with conver

help with php
It's not displaying or pulling anything out of the database.


Code: <html><

Facebook status update API
Hello,

So, I'm trying to create my first Facebook application with PHP.

Basic ideas fo

A little help needed passing hidden values to next page
I have a page that has hidden values in a form.

example
Code: <input name='signupID

Quick variable question
hey guys/gals,
im trying to write a php script and it works fine as i have it, but i need to set

Code error with Index.php
Error: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/runevid/public_

Storing the referrer in session... problems with tabs
Hello All

I am currently working on an ERP project based on the MVC methodology, when a user

PHP Directory Listing Not working
Hey Guys,

I need help, I tried a ton of directory listing scripts and they all don't work. Al

Install page
How do I make it so when a user submits information on the Install page, it'll right it into the cor

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