Jump to content


Photo

Displaying data in columns


  • Please log in to reply
2 replies to this topic

#1 jdonisthorpe

jdonisthorpe
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 27 September 2006 - 04:20 PM

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";
}

#2 freakus_maximus

freakus_maximus
  • Members
  • PipPipPip
  • Advanced Member
  • 177 posts

Posted 27 September 2006 - 04:47 PM

Check out the FAQ/CODE Repository forum on phpfreaks that should answer your question.

http://www.phpfreaks...ic,95426.0.html

#3 jdonisthorpe

jdonisthorpe
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 27 September 2006 - 04:49 PM

OOoh, I really tried to find something like that.  Thank you!





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users