Why is the serial no always 0 while I put other numbers?
Php file:
<html>
<body>
<?php
$con = mysql_connect("localhost","eduardli_user","-z.x,c");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
$description = $_POST["description"];
$price = $_POST["price"];
$quantity = $_POST["quantity"];
mysql_select_db("eduardli_company", $con) or die(mysql_error());
mysql_query ("INSERT INTO Products (description, price, quantity)
VALUES ('$description', '$price', '$quantity')") or die(mysql_error());
$latest="select * from Products order by serialno desc limit 0,1";
$result = mysql_query($latest,$con) or die(mysql_error());
$row = mysql_fetch_array($result);
{
echo $row . " " . $row . " " . $row . " " . $row;
echo "<br />";
}
mysql_close($con);
?>
</body>
</html>
form.html:
<html>
<head>
<style type="text/css">
#desc
{
width:10%;
height:5%;
}
</style>
<title>POST</title>
</head>
<body>
<form action='insert.php' method="post">
Serialno.: <input type="text" name="serialno" id="serialno"><br />
Description: <input type="text" name="description" id="description"><br />
Price: <input type="text" name="price" id="price" /><br />
Quantity: <input type="text" name="quantity" id="quantity" />
<input type='submit' value='submit' />
</form>
</body>
</html>