how to add an image in a php table
Posted: Sat Jun 05, 2010 10:35 am
hi, in a script, I have a php file, that presents a table of items, for music artists, however, there's something missed in this table, I need to add in the table, an image for the artist... I'm so new weby, and don't know how to do that, however I tried to do something:
when I go to the frontend page, where the script in, it doesn't display the image in the 4th cell, still blank.
so how to correct this.
the .php file is in the attachments.
Code: Select all
if($this->params->get('showartistshome') || $this->letter != ""){
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="sectiontableheader" align="right" width="5%">#</td>
<td class="sectiontableheader" width="60%"><? echo JText::_('المرنم'); ?></td>
<td class="sectiontableheader" align="right" width="10%"><? echo JText::_('الألبومات'); ?></td>
<td class="sectiontableheader" align="right" width="10%"><? echo JText::_('المقاطع'); ?></td>
<td class="sectiontableheader" align="right" width="20%"><? echo JText::_('صورة'); ?></td>
</tr>
<?php
$k = 1;
for ($i=0, $n=count( $this->items ); $i < $n; $i++) {
$row = &$this->items[$i];
$link= JRoute::_( 'index.php?option=com_muscol&view=artist&id='. $row->id . $itemid);
$artist_image = JHTML::image('images/artists/' . $this->artist->image , $this->artist->name , $image_attr );
?>
<tr class="sectiontableentry<? echo $k; ?>" >
<td align="right"><? echo ($i + 1); ?></td>
<td><a href='<?php echo $link; ?>'><?php echo $row->artist_name; ?></a></td>
<td align="right"><?php echo $row->num_albums; ?></td>
<td align="right"><?php echo $row->num_songs; ?></td>
<td align="right"><?php echo JHTML::image('images/artists/' . $this->artist->image , $this->artist->name , $image_attr ); ?> </td>
</tr>
<? $k = 3 - $k; } ?>
</table>
so how to correct this.
the .php file is in the attachments.