Here's the issue:
I have register.php pointing my form to submit-registration.php, which will insert data into a database (blueplanet) table (users). The form works correctly in pointing to submit-registration.php, but the submit-registration.pph does not insert into the table, although it looks as though it is connecting to the database.
Anyway, here is the code I have for submit-registration.php. Can someone look at it and tell me what could possibly be the problem? Thanks!
Code: Select all
<?php
if ($_SERVER['REQUEST_METHOD'] == "POST") {
mysql_connect(localhost,root,probiz123);
@mysql_select_db(blueplanet) or die( "Unable to select database");
// the following 4 lines are needed if your server has register_globals set to Off
$fname = $_POST['fname'];
$lname = $_POST['lname'];
$address1 = $_POST['address1'];
$address2 = $_POST['address2'];
$city = $_POST['city'];
$state = $_POST['state'];
$zip = $_POST['zip'];
$username = $_POST['username'];
$password = $_POST['pwd'];
$hear = $_POST['hear'];
$empbus = $_POST['empbus'];
$favtravel = $_POST['favtravel'];
$phone = $_POST['phone'];
$SQL = "INSERT INTO 'users'";
$SQL = $SQL . "(fname, lname, address1, address2, city, state, zip, username, pwd, hear, empbus, favtravel, phone) VALUES";
$SQL = $SQL . "('$fname', '$lname','$address1','$address2','$city','$state','$zip','$username','$password','$hear','$empbus','$favtravel','$phone')";
$result = mysql_db_query($db,'$SQL',$cid);
if (!$result) {
echo("ERROR: " . mysql_error() . "\n$SQL\n"); }
echo ("Your registration has been submitted. You can now login to the Blue Planet Website.\n");
}
mysql_close($cid);
?>