Pager 2.x class

From: Date: Fri, 22 Oct 2004 16:05:44 +0000
Subject: Pager 2.x class
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-15045@lists.php.net to get a copy of this message
Are there any examples of how to use Pager 2.x class on a eg. for( $i = 1; $row = mysql_fetch_array($result); $i++ ) ? The examples I've found aren't addressing that. I am not using the DB class else I would use the DBPager class. Note: I tried DB but it's easier for me not to imho. Looking at my code below there's an embedded query inside another query - I could load the total results into a assoc. array then use that w/ pager(?). If anyone could recommend a startegy or snippet I'd be grateful. Thanks, Lee g. for( $i = 1; $row = mysql_fetch_array($result); $i++ ) { echo "$i. Title: <b> ".$row['title']."</b><br>"; $query1 = "SELECT url_pages.page_url FROM url_pages WHERE page_id=$row[page_id]"; $result1 = mysql_query($query1); for( $j = 1; $row1 = mysql_fetch_array($result1); $j++ ) { If( $row1['page_url'] == null) { echo "URL: <i>N/A</i><br>"; } else { echo "URL: <a href=".$row1['page_url'].">".$row1['page_url']."</a><br>"; $url_col .= "<a href=".$row1['page_url'].'>'.$row1['page_url'].'</a><br>'; } } echo "Description: ".$row['descrip']."<p>"; }

« previous php.pear.general (#15045) next »