Hi,
I am writing a script for part of a homepage where the 5 latest features are listed.
What I want to do is this:
query database with limit 5.
I want to ignore the first entry returned as this is already covered elsewhere on the page.
With the second return I want to list the title, image and first 100 words of the content.
With the third return I want to list title and first 100 words of content.
With 4th and 5th I just wan tto return the title.
Heres my attempt (at the moment it just returns a parse error but i don' think the code is right anyway...)
<?
$link_id = db_connect("b34t");
$query = "select * from features order by id desc limit 5";
$result = mysql_query($query);
while($home = mysql_fetch_array($result)){
$title = $home[1];
$red_content = (substr("$home[3]", 0, 100));
for ($i = 0; $i < count($home[0]); $i++)
{
if($i == 0){};
elseif ($i == 1){echo "<font size='1'>$title[$i], $red_content<br>"};
elseif ($i == 2){echo "<font size='1'>$title[$i], $red_content<br>"};
elseif ($i == 3){echo "<font size='1'>$title[$i]<br>"};
elseif ($i == 4){echo "<font size='1'>$title[$i]<br>"};
}
}
?>
Please help...