tranquillo
Technical User
Hi... I need some help with a list that I wanna do in php.
I want two lists of events with dates that are devided in coming and previous events. so I'd need a php-tagg that lists all events in a table where date<now or date>now. and I'd like the background to be different on every second row... gray-white-gray-white. and so on...
I'm kind of new at php. and I wanna know what's wrong with this code...
<?php
$db = mysql_connect("localhost", "root"
mysql_select_db("seko",$db);
$sql = "SELECT * FROM arbetsgivare";
$result = mysql_query($sql);
while ( $row = mysql_fetch_array ($result)){
echo ($var%2) ? "#999999" : "#FFFFFF";
echo $row[0];
}
?>
I want two lists of events with dates that are devided in coming and previous events. so I'd need a php-tagg that lists all events in a table where date<now or date>now. and I'd like the background to be different on every second row... gray-white-gray-white. and so on...
I'm kind of new at php. and I wanna know what's wrong with this code...
<?php
$db = mysql_connect("localhost", "root"
mysql_select_db("seko",$db);
$sql = "SELECT * FROM arbetsgivare";
$result = mysql_query($sql);
while ( $row = mysql_fetch_array ($result)){
echo ($var%2) ? "#999999" : "#FFFFFF";
echo $row[0];
}
?>