Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

Showing multiple records in a row from MYSQL

$
0
0

I am new and trying to figure out a way to take my records from the data base and display 4 to a row instead of just one record at a time...

 

Here is the code I am working with.

$query = "select * from products";
$result = mysql_query($query);

echo "<table width=\"100%\" border=\"0\" align=\"center\">\n"; 

while($row=mysql_fetch_array($result, MYSQL_ASSOC))
{
	$prodid = $row['prodid'];
	$description = $row['description'];
	$price = $row['price'];
	$quantity = $row['quantity'];
	


	echo "<tr><td align = \"center\">\n";
	echo "<tr><td><img src=\"showimage.php?id=$prodid\" width=\"80\" height = \"80\">\n</br>";
	echo  "<a href=\"updatecart.inc.php?id=$prodid\"> $description </a>" ;
	echo "</td></tr>\n";
}
echo "</table>\n";

?>

I thank you in advance for your help.

 

 


Viewing all articles
Browse latest Browse all 13200

Trending Articles