Hi guys,

I know its too much to ask for but i am a beginner (self-taught) at PHP. Iam tring to build a news website and have this script that i want to implement pagination on. Any kind of pagination will do. Please help and if you can explain how you have done it. its $query getDisplay i want to paginate.
This is the script: p.s i know about the wrong AUTHOR spellings.

$var1_getDisplay2 = "-1";
if (isset($_GET['archive'])) {
  $var1_getDisplay2 = $_GET['archive'];
  $query_getDisplay = sprintf("SELECT news.title, news.blog_entry, DATE_FORMAT(news.updated, '%%M %%e, %%Y') AS formatted FROM news WHERE DATE_FORMAT(news.updated, '%%Y-%%m') = %s ORDER BY news.updated DESC", GetSQLValueString($var1_getDisplay2, "text"));
} elseif (isset($_GET['post_id'])) {
  $var2_getDisplay3 = $_GET['post_id'];
  $query_getDisplay = sprintf("SELECT news.title, news.blog_entry, DATE_FORMAT(news.updated, '%%M %%e, %%Y') AS formatted FROM news WHERE news.post_id = %s", GetSQLValueString($var2_getDisplay3, "int"));
} else {
  $query_getDisplay = "SELECT *, DATE_FORMAT(updated, '%M %e, %Y') AS formatted FROM news new, authors aut WHERE aut.aurthor_id=new.arthor_id ORDER BY updated DESC LIMIT 15";
}
$getDisplay = mysql_query($query_getDisplay, $check_mag) or die(mysql_error());
$row_getDisplay = mysql_fetch_assoc($getDisplay);
$totalRows_getDisplay = mysql_num_rows($getDisplay);

Whats the link for?

Help still needed here...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.