0 ) { $hits = mysql_num_rows($result2);//number of results returned $num_col = 3;//number of columns $num_col_printed = 0;//number of columns printed $num_rows = ceil($hits / $num_col);//number of rows needed $contact_list = ""; while ($row = mysql_fetch_array($result)) { $id = $row['id']; $file = $row['file']; $image = $row['image']; // Test Results $str = strtotime($startdate. "+1 week"); $future = date('Y-m-d', $str); if ($num_col_printed == $num_col) { $contact_list .= "\n\n"; $num_col_printed = 0; } // output row from database $contact_list .= ""; // bump up row counter $num_col_printed++; } // end while loop $colstobalance = $num_col - $num_col_printed; for ($i=1; $i<=$colstobalance; $i++) { $contact_list .= "\n"; } $contact_list .= "
"; $contact_list .= "
"; $contact_list .= "Template $file

"; $contact_list .= "
"; /////////////////////////////////////////////// //This is where I will put my next page code.// /////////////////////////////////////////////// // Figure out the total number of results in DB: but isn't working //$total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM pages"),0); // Figure out the total number of pages. Always round up using ceil() $total_pages = ceil($hits / $max_results); $to_display = $from + $max_results; $from_display = $from + 1; if ($to_display > $hits) { $to_display = $hits; } // Build Page Number Hyperlinks $pagelistings = "
Specials   Inquiries      Results: $from_display - $to_display of $hits       "; // Build Previous Link if($page > 1){ $prev = ($page - 1); $pagelistings .= "<<Previous - "; } for($i = 1; $i <= $total_pages; $i++){ if(($page) == $i){ $pagelistings .= "$i "; } else { $pagelistings .= "$i "; } } // Build Next Link if($page < $total_pages){ $next = ($page + 1); $pagelistings .= " - Next>>"; } $pagelistings .= "
"; ////////////////////////// //End of next page code.// ////////////////////////// } else { $contact_list = "Nothing found under your selections"; } ?> Basic Templates
">" width=200 height=90 border=0>