Have been struggling all morning to get a form to insert to a database so simplified everything to this
now when i run that page i get a blank page displayed but when i check the database nothing has been added.
First is the code correct? as i think the variabals are ok
PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
$hostname_conn = "localhost";
$username_conn = "*****";
$password_conn = "********";
$conn = mysql_connect($hostname_conn, $username_conn, $password_conn);
if (!$conn)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("Impact",$conn);
mysql_query("INSERT INTO test (1, 2)
VALUES ('Pete', 'Grif')");
mysql_close();
?>
</body>
</html>
now when i run that page i get a blank page displayed but when i check the database nothing has been added.
First is the code correct? as i think the variabals are ok