Hi, I currently use this for extracting data from my DB. $new = new database; $new->selects("SELECT * FROM table"); $result = $new->getRes(); $countrows = $new->countrows(); $smarty->assign('result', $result); $smarty->assign('countrows', $countrows); PHP: I have come across this though to extract data but includes pagnation also. $dataCollection = array(); $getData = mysql_query("SELECT * FROM table"); $countrows = mysql_num_rows($getData); while ($r=mysql_fetch_array($getData)) { $tmp = array( 'field1' => $r['field1'], 'field2'=> $r['field2'], 'field3'=> $r['field3'], 'field4'=> $r['field4'], 'field5'=> $r['field5'] ); array_push($dataCollection, $tmp); } // Assign the results to an array $pagination = new pagination(); $dataPages = $pagination->generate($dataCollection, 6); $smarty->assign('listing', $dataPages); $smarty->assign('pagination', $pagination->links()); $smarty->assign('countrows', $countrows); PHP: My question is there any way to include the pagnation section into the first example as i don't like having to list all my fields. Cheers, Adam
replace this in the second part should do the trick $tmp = array(); foreach ($r as $key=>$value) { $tmp[$key] = $value; }