Hi I have a section of my site that the clients wants to be random instead of displayed in a logical order located here.
http://www.altoonastudenthousing.com/search.php?&page=0
It has pagination for all of the listings … Is there a way list them randomly but not repeating the results pages forward so everyone gets a fair listing?
this is the code currently
[php]else
$sql2.= ’ featured, RAND() ';
if (isset($search[‘order_by’]) && $search[‘order_by’] != ‘ANY’
&& isset($search[‘order_by_type’]) && $search[‘order_by_type’] != ‘ANY’ &&
($search[‘order_by_type’] == ‘DESC’ || $search[‘order_by_type’] == ‘ASC’ ))
$sql2.= $search[‘order_by_type’];
$sql2.= ’ LIMIT ’ . $results_page . ', ’ . $conf[‘search_results’];
// End creating sql query
// If property type specified we add it into the table
// header
if (isset($search[‘type’]) && $search[‘type’] != ‘ANY’) {
// Select all property types from the database
$sql5 = 'SELECT id, ’ . $language_in . ', counter FROM ’ . TYPES_TABLE . ’ WHERE id = ’ . $search[‘type’];
$r5 = $db->query ( $sql5 ) or error (‘Critical Error’, mysql_error () );
$f5 = $db->fetcharray( $r5 );
$table_category = ’ / ’ . $f5[1];
}
else
$table_category = ‘’;[/php]