Dear halojoy
Thank you for your reply
My code aims to bring articles from the database depending on the class (sport, politics, community...).
After inserting too many articles the list goes very long. So, i want to divide it to pages, 10 records per page for instance. (I think I've expressed this in a wrong way in my previous post)
My database contains the columns: id, class, address, text, view, date
The exact code i have is something like the following:
include 'config/config.php';//defines user, password and DB
include 'config/connection.php';//contains $connect and $dbselect. It estableshes connection and selects the database
if (!$connect || !$db_select){
echo("<center>Sorry, Internal error has occured. We will fix it soon!</center>");
exit;
}
$result_query=mysql_query("SELECT * FROM articles WHERE class='sport' and view='show' ORDER BY date DESC");
if (mysql_num_rows($result_query) == 0) {
echo "<center>Sorry, there are no articles in this section yet.</center>";
exit;
}
while($result=mysql_fetch_array($result_query)){
echo ("<a href='showarticle.php?id=$result[id]'>$result[address]</a><br/>");
}
mysql_free_result($result_query);
?>
I'll start with the idea you've mentioned. I hope it will be helpful to me.
I appreciate any extra advices you could offer
Thanks alot.