Hi,
I have written a pice of code that retrieves data from a mysql database. At the moment every reuslt is displayed in the same way.
What I want to do is alternate the layout of the return so that in the first return the image is aligned left and the second right and then the third left etc etc..
|-------|text text text
| |text text text
|-------|text text text
text text text|-------|
text text text| |
text text text|-------|
perhaps a for loop or something to count the returns would make it possible to align all odd numbers left and all even numbers right???
Heres the current code.
<?
$link_id = db_connect("b34t");
$query = "select id, title, date_format(date, '%M %D %Y'), content, image_url from features order by id desc";
$result = mysql_query($query);
while($myrow = mysql_fetch_row($result)) {
$myrow[3] = nl2br($myrow[3]);
$myrow[3] = (substr("$myrow[3]", 0, 200));
$id = $myrow[0];
$image = $myrow[2];
if($image){echo "<img src=\"$image\" align=\"left\">";}
echo"
<font face=\"verdana\" size=\"1\">
<b>Title:</b> <a href='features2.php?id=$id'>$myrow[1]</a><br>
<b>Date:</b> $myrow[2]<br>
<b>Info:</b> $myrow[3]<br><br></font>";
}
?>
Please help!