B
bigblip
Guest
what is the actual code? this is what i wrote.
<?php
if (isset($_POST['addproduct']))
{
$name = $_POST['productname'];
$desc = $_POST['desc'];
$price = $_POST['price'];
$image = $_POST['image'];
mysql_query("INSERT INTO products VALUES (null,'$productname','$desc','$price','$image)'") or die("Cannot insert new row. Error: ". mysql_error() ." Query: INSERT INTO products VALUES ('$name','$desc','$price','$image')");
echo "Successfully entered new product.<br>";
}
$result=mysql_query($query) or die(mysql_error());
while ($row=mysql_fetch_array($result))
{
echo"<tr>";
echo "<td>{$row['productname']}</td><td>{$row['description']}</td><td>{$row['price']}</td><td>{$row['image']}</td>";
echo "</tr>";
}
?>
<?php
if (isset($_POST['addproduct']))
{
$name = $_POST['productname'];
$desc = $_POST['desc'];
$price = $_POST['price'];
$image = $_POST['image'];
mysql_query("INSERT INTO products VALUES (null,'$productname','$desc','$price','$image)'") or die("Cannot insert new row. Error: ". mysql_error() ." Query: INSERT INTO products VALUES ('$name','$desc','$price','$image')");
echo "Successfully entered new product.<br>";
}
$result=mysql_query($query) or die(mysql_error());
while ($row=mysql_fetch_array($result))
{
echo"<tr>";
echo "<td>{$row['productname']}</td><td>{$row['description']}</td><td>{$row['price']}</td><td>{$row['image']}</td>";
echo "</tr>";
}
?>