The Best Source of Muslim Shia Videos
Online Viewers: 817

Pagination Tutorial for PHP MySQL Programmers Web Intersect Paging Database Results - English

  • Embed Video
  • Add to Favourites

8405 Views


Pagination Tutorial For PHP MySQL Programmers Web Intersect Paging Database Results - English
Get the independent generic version of this tutorial in text tutorial form here: http://www.developphp.com/tutorial_read.php?tid=198 Web Intersect Source Code: http://www.webintersect.com Adam teaches how to throw down on custom PHP MySQL Pagination programming.
Having difficulty playing this video? Click here and let us know.
ShiaTV does not endorse any User Submission or any opinion, recommendation, or advice expressed therein, and ShiaTV expressly disclaims any and all liability in connection with User Submissions.

Comments

Add Comment

sri

-

I am working on the similar one but with XML feed not with MYSQL

if (isset($_GET['page']))
{
$startPage = preg_replace("#[^0-9]#","",$_GET['page']);
}else{
$startPage=1;
}
$perPage =2;
$currentRecord = 2;
$rss = new DOMDocument();
$rss->load('http://www.mnsu.edu/news/papers/library/rss.xml');
$feed = array();

foreach ($rss->getElementsByTagName('item') as $node) {
$item = array (
'title' => $node->getElementsByTagName('title')->item(0)->nodeValue,
'link' => $node->getElementsByTagName('link')->item(0)->nodeValue,
);
array_push($feed, $item);
$currentRecord +=1 ;
if($currentRecord > ($startPage * $perPage) && $currentRecord < ($startPage * $perPage + $perPage)){
echo "
";
}
}
//and the pagination:
for ($x = 1; $x <= ($currentRecord / $perPage); $x++) {
$title = str_replace(' & ', ' & ', $feed[$x]['title']);
$link = $feed[$x]['link'];
echo '

'.$title.'
';
}