hello. I have an existing php file that is an integral part of the framework of website and would like to include pagination within it. You will that it outputs existing results to html page and i would like it to remain this way. Here is the exisitng code: function ShowMyFiles() { // vars global configuration global $dbConn, $theme_path; // vars messages global $msg; // vars template global $error_msg, $pagination, $files, $owner, $test; if ($err) { $error_msg = $msg['20191']; } //$links_obj = new clsLink; // get file listing $query = "select title, description, date from idx_reslink where category_id=1 LIMIT 10"; //$links_obj->query = $query; //$links_obj->table_name = "idx_users"; // $links_obj->date_format = $msg["10151"]; //$links_obj->max_rows = 100; //$files = $links_obj->Display(); $query = "select title, description, date from idx_reslink where category_id=1 LIMIT 10"; $result = $dbConn->Execute($query); //$files = $result->Fields("url"); // $owner = $result->Fields("owner"); // $date = $result->Fields("date"); // $files = explode ( " ", $files ); $test = ''; for($i = 0;$i < $result->RecordCount(); $i++) { $date = $result->Fields("date"); $description = $result->Fields("description"); $title = $result->Fields("title"); $test .= '<table width="100%%" border="0"> <tr> <td></td> </tr> </table> <table cellpadding="2" cellspacing="1" border="0" align="center" width="100%" class="tbl_border_mem"> <tr class="tbl_caption_mem"> <td width="16%"><strong>Date</strong></td> <td width="51%"><strong>Description</strong></td> <td width="13%"><strong>Date Added</strong></td> </tr> <tr class="tbl_caption_mem"> <td valign="top">'.$title.'</td> <td valign="top">'.$description.'</td> <td valign="top">'.$date.'</td> </tr> </table>'; $result->movenext(); } $files = $test; DisplayTemplate($theme_path . "cp/pl37-39files.html", "\$files,\$pagination,\$error_msg"); } Code (markup): i have tried various options to code this, but my php is just not good enough to accomplish this task. many thanks for your help.
your can use "LIMIT 0,10" or "LIMIT 10,20" in your query to filter your results. if you give a query string to your page you can make this dynamically. i hope this is clear enough
sorry aRo`, not with you. could you expand? sorry to be a thicky, but totally new to php, as you can tell