View Single Post
Old 09-24-2012, 02:10 PM   PM User | #1
jawittdesigns
New Coder

 
Join Date: Sep 2012
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
jawittdesigns is an unknown quantity at this point
Need Help with database Queries in HTML tables

Hi,

I having problems displaying queries from a mySQL database. I want to display images and descriptions in a html table four columns wide.

so far I cam up with this.

PHP Code:
while ($row mysql_fetch_array$result )){
$entry_name $row['entry_name'];
$entry_submition $row['entry_filename'];
$entry_pic '<div class="display-img"> <img src="../photos/'.$row['entry_filename'].'"></div>';
$count=4;
echo 
"<table>";
  
   echo 
'<tr>';
   for (
$counter=0$counter <$count$counter++){
        echo 
'<td>'.$entry_name.'<br>'.$entry_pic.'<td>';
   } 
  echo 
'</tr>';
echo 
"</table>";

This displays the table correctly, but it shows each item four times in each row.

What I need it to show each item once.

If any one can help. That would be great
jawittdesigns is offline   Reply With Quote