View Single Post
Old 04-09-2006, 11:07 PM   · #3
wackyjoe
NamePros Regular
 
Trader Rating: (4)
Join Date: Dec 2005
Posts: 206
NP$: 270.00 (Donate)
wackyjoe is on a distinguished road
Nice Tutorial ... another way would be:

PHP Code:
echo "<table>";
$color1 = "#EEEEEE";
$color2 = "#FFFFFF";
$rowc = 0;

$sql = mysql_query("SELECT * FROM places ORDER BY id LIMIT 5");

while (
$row = mysql_fetch_array($sql) {

$row_color = ($rowc % 2) ? $color1 : $color2;  //basicly like a if()

echo "
   <tr>
    <td width="
110" bgcolor="$row_color" nowrap>
    $article_date</td>
    <td bgcolor="
$row_color">
    <a href="
whteva.php?cmd=full_article&article_id=$article_id">$article_title</a></td>
    </tr>"
;
   
   

    
$rowc++; //increment by 1
}
echo
"</table>";


Please register or log-in into NamePros to hide ads
wackyjoe is offline   Reply With Quote
Site Sponsors
Traffic Down Under Traffic Down Under free webhosting
Advertise your business at NamePros
All times are GMT -7. The time now is 05:01 AM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.