Php Version: 4.3.10
mysql version: 4.19
I need assistance in displaying images from a database into a table.
The script is successfully getting the image from the database in placing them
int he table that i created. The problem is, each row is repeating the same
image, ie, item one is shown in column 1, column 2, column3 , and column 4 in
row 1. The item 2 is shown in column 1, column 2, column3 , and column 4 in row
2, and so on. I am at a lost on how to display the images so that each item is
displayed in consectively rows and columns as needed without repeating
themselves. I will copy the script below.
If any one can see my error, i would appriciate the input. Thanks:
<?php #catalog.php - display all catalog items
include('includes/header.php');
require_once('connect/mysql_connect.php');
$query="SELECT item_id, modelnum, name, upload, size, description, price,
gender FROM clothing ORDER BY item_id ASC";
[EMAIL PROTECTED]($query);
[EMAIL PROTECTED]($result);
if($num>0) {
while($row=mysql_fetch_array($result))
echo '
<table border="0" width="90%" cellspacing="3" cellpadding="3"
align="center">
<tr>
<td align="center" width="20%"><font
color="teal">cAclOm'.$row['modelnum'].'</font>
<span style="padding-left:5%">'.$row['name'].'</span><br /><br />
<img src="/coles/admin/new_images/'.$row['upload'].'" width="120"
height="140" /><br />
'.$row['description'].'<span
style="padding-left:5%">'.$row['price'].'</span>
</td>
<td align="center" width="20%"><font
color="teal">cAclOm'.$row['modelnum'].'</font>
<span style="padding-left:5%">'.$row['name'].'</span><br /><br />
<img src="/coles/admin/new_images/'.$row['upload'].'" width="120"
height="140" /><br />
'.$row['description'].'<span
style="padding-left:5%">'.$row['price'].'</span>
</td>
<td align="center" width="20%"><font
color="teal">cAclOm'.$row['modelnum'].'</font>
<span style="padding-left:5%">'.$row['name'].'</span><br /><br />
<img src="/coles/admin/new_images/'.$row['upload'].'" width="120"
height="140" /><br />
'.$row['description'].'<span
style="padding-left:5%">'.$row['price'].'</span>
</td>
<td align="center" width="20%"><font
color="teal">cAclOm'.$row['modelnum'].'</font>
<span style="padding-left:5%">'.$row['name'].'</span><br /><br />
<img src="/coles/admin/new_images/'.$row['upload'].'" width="120"
height="140" /><br />
'.$row['description'].'<span
style="padding-left:5%">'.$row['price'].'</span>
</td>
</tr>';
}
echo '</table>';
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com
Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php