I have this php page that works fine. However, I need a loop in there so it reads all the lines in my table in the database. As of now it is only returning the first line of the table. Can anyone help me?
<?php
$Name=$_GET['Name'];
$Description=$_GET['Description'];
$Price=$_GET['Price'];
$type = $_GET['type'];
// open connection to database
$connect = mysql_connect("localhost", "root", "");
if (!$connect)
{
print "unable to connect!";
exit;
}
//select database to use
$db= mysql_select_db ("mapleside");
if (!$db)
{
print "could not select database";
exit;
}
// create SQL query string
$query = "SELECT * from $type"; // Well select entries from the table selected in the form
$result = mysql_query($query) or die
('Error, select query failed');
$row = mysql_fetch_array($result);
$name = $row["Name"];
$Description = $row["Description"];
$Price = $row["Price"];
echo $name.'<br>';
echo $Description.'<br>';
echo $Price.'<br>';
mysql_close();
?>