<?php
$query_Recordset_List = "SELECT * FROM table";
$Recordset_List = mysql_query($query_Recordset_List, $baglanti) or die(mysql_error());
$totalRows_Recordset_List = mysql_num_rows($Recordset_List);
$i = 0;
echo "First 3 items: "."<br /><br />";
while ($row_Recordset_List = mysql_fetch_assoc($Recordset_List))
{
$i++;
echo $row_Recordset_List['id']."<br />";
if ($i == 3)
{
break;
}
}
if ($totalRows_Recordset_List > 3)
{
echo "<br />Other items: "."<br /><br />";
while ($row_Recordset_List = mysql_fetch_assoc($Recordset_List))
{
echo $row_Recordset_List['id']."<br />";
}
}
?>
|