I don´t understand the error:
Parse error: syntax error, unexpected T_VARIABLE in /home/eduardli/public_html/web_designer/insert.php on line 21
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);
mysql_query ("INSERT INTO Products (Description, Price, Quantity)
VALUES ('$description', '$price', '$quantity')");
mysql_query("SELECT*FROM Products='"$result"'");
while($row = mysql_fetch_array($result))
{
echo $row['Description'] . " " . $row['Price'] . " " . $row['Quantity'];
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">
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>