<html>
<head>
<title>Updated</title>
</head>
<body>
<?php
$link = mysql_connect('localhost', 'josephha_salesm', 'lamepassword1');
if (!$link) {
die('Not connected : ' . mysql_error());
}
$db_selected = mysql_select_db('josephha_carsales', $link);
if (!$db_selected) {
die ('Can\'t use carsales : ' . mysql_error());
}
$strSQL = "INSERT INTO salesreport(Neworused) values('" . $_POST["Neworused"] . "')";
$strSQL = "INSERT INTO salesreport(Make) values('" . $_POST["Make"] . "')";
$strSQL = "INSERT INTO salesreport(Model) values('" . $_POST["Model"] . "')";
$strSQL = "INSERT INTO salesreport(Price) values('" . $_POST["Price"] . "')";
$strSQL = "INSERT INTO salesreport(Salesid) values('" . $_POST["Salesid"] . "')";
// Close the database connection
mysql_query($strSQL) or die (mysql_error());
mysql_close();
?>
<h1>The database is updated!</h1>
</body>
</html>
The code runs and updates that database when I only have Salesid, when I add the other char fields they all return an empty field. When I add the price field only the price shows up, the rest return empty values.