Show 20 results a page
Posted: Thu May 07, 2009 10:43 am
PHP code: this is getting all the data from news table.
and this is where i post results:
since i have over 100 data in that table, they all show up in one page.
I hope to get help to show 20 results in a page with using these codes.
Thanks a lot.
Code: Select all
<?php
mysql_select_db($database_TL, $News);
$query_Recordset1 = "SELECT *,DATE_format(date, '%d.%m.%Y ') as newdate FROM `news` order by date desc";
$Recordset1 = mysql_query($query_Recordset1, $News) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
Code: Select all
<?php
$idx = 1;
do {?>
<p><strong><?php echo $row_Recordset1['newdate']; ?> - <?php echo $row_Recordset1['writer']; ?></strong>
<br /><a href="article.php?id=<?php echo $row_Recordset1['id']; ?>"><?php echo $row_Recordset1['baslik']; ?></a></p>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
I hope to get help to show 20 results in a page with using these codes.
Thanks a lot.