hey guys.
i'm new to php and have a problem inserting data into a mysql table from a form. its connecting ok and comes up data inserted successfully and a new row gets created but the data is blank. any help would be appreciated. thanx. my code is below
HTML
PHP
$connection=mysql_connect("localhost","pp","mm") or die('Could not connect to the database server');
$db = mysql_select_db("test", $connection) or die ("Unable to select database.");
$sql = "INSERT INTO registration (Name,Email)
VALUES ('$name','$email')";
$sql_result = mysql_query($sql,$connection) or die ('Could not insert data');
echo('Data inserted successfully');
mysql_close($connection);
?>
Email replies to this thread, to the address above.
??wrote: > > hey guys. > i'm new to php and have a problem inserting data into a mysql > table from a form. its connecting ok and comes up data > inserted successfully and a new row gets created but the data > is blank. any help would be appreciated. thanx. my code is > below > > HTML > > > PHP > $connection=mysql_connect("localhost","pp","mm") or > die('Could not connect to the database server'); > $db = mysql_select_db("test", $connection) or die ("Unable to > select database."); > $sql = "INSERT INTO registration (Name,Email) > VALUES ('$name','$email')"; > $sql_result = mysql_query($sql,$connection) or die ('Could > not insert data'); > echo('Data inserted successfully'); > mysql_close($connection); > ?> ">??