Jump to content

Archived

This topic is now archived and is closed to further replies.

jdonisthorpe

Displaying data in columns

Recommended Posts

I am just learning php and trying to build a basic html page with columns.  The following script displays all my data in one column.  Now I am trying to figure out how to get it into three columns! Here is the code.  Any help is greatly appreciated!

$query = "SELECT * FROM products WHERE CATEGORY LIKE '%anklet%'";
$result = mysql_query($query) or die ("couldnt execute query.");
//Display results in a table
while ($row = mysql_fetch_array($result,MYSQL_ASSOC))
{
echo "<table>";
echo "<tr>";
echo "<td><a href=\"{$row['BUYURL']}\"><img src=\"{$row['IMAGEURL']}\"><br>";
echo "{$row['NAME']}<br>\n";
echo "{$row['PRICE']}\n";
}

Share this post


Link to post
Share on other sites
Check out the FAQ/CODE Repository forum on phpfreaks that should answer your question.

[url=http://www.phpfreaks.com/forums/index.php/topic,95426.0.html]http://www.phpfreaks.com/forums/index.php/topic,95426.0.html[/url]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.