|
Posted by satyakaran on 05/21/07 06:35
On May 18, 7:47 am, bokke <micr...@gmail.com> wrote:
> Hi - I am using this code
>
> echo "<tr><td></td><td id=tablesdirhead>Property Information</td><td
> id=tablesdirhead width='100'>Agent Name</td><td id=tablesdirhead
> width='150'>Contact Info</td></tr>\n";
> while ($myrow = mysql_fetch_row($result))
> {
> $row = 1-$row;
> $color = ($row==0)?"#F5F5F5":"#F0F8FF";
> printf("<tr bgcolor=$color><td>%s</td><td>%s</td><td>%s</td><td>%s</
> td></tr>\n",
> $myrow[5], $myrow[3], $myrow[0], $myrow[1]);}
>
> echo "</table>\n";
> ?>
>
> But would like to give the fourth "$myrow[1]" a PHP link like
>
> <a class="dir" href="processformImage.php?action=&ID=<?php echo
> $row["StoreID"]; ?>">$myrow[1]</a>
>
> But can't seem to find anywhere on the web that shows this can even be
> done
And instead of writing printf();, you should write like this:
echo '<tr>
<td>'.$myrow[0].'</td>
<td>'.$myrow[1].'</td>
</tr>
';
Here you can easily format/add anything for any column.
echo '<tr>
<td>'.$myrow[0].'</td>
<td>'.$myrow[1].'</td>
<td>'.$myrow[2].'</td>
<td>'.$myrow[3].'</td>
<td>'."<a class='dir' href='/index.php?storeID=$row[9]'>
$myrow[4]</a>.'</td>
</tr>
';
satya61229.blogspot.com
[Back to original message]
|