Evening all
I have a While loop querying my database, but I’m confused about one thing. I have four records being called out of the database and I want the 2nd and 4th records to have a class attached to them called ml and records 1st and 3 not to.
So here’s my code
$SQL = "SELECT * from blah desc LIMIT 1,4";
$result = mysql_query($SQL) OR die(mysql_error());
while ($row = mysql_fetch_assoc($result))
{
$ml10 = ($ml10=='' ? 'ml' : '');
echo '
<li class='.$ml10.'">
</li>
';
}
And here’s the line I’m trying to do it on:
$ml10 = ($ml10=='' ? 'ml' : '');
But it does not seem to work. That aligns the 1st and 3rd ones left, but I want the other ones done! Any ideas?