Storing data from a form into a MySQL database! Help needed.
Hello "codingforums" world.
I'm having trouble inserting data from my html form into a MySQL database.
This is the segment in my code that is not working.
I successfully connect to the database but when I try to insert it I get an error message.
My table name is onlineapp
firstname is the field in the table
$firstname is where I stored the cookie of the data from the first page of my form
$sql = "INSERT INTO onlineapp (firstname) VALUES ('$firstname')";
die('Error: ' . mysql_error());
echo "1 record added";
If you need more details please let me know because I've been stuck on trying to fix this without any success.