Code: Select all
$sql_query = "SELECT * FROM $tablevar WHERE FIND_IN_SET('download',DisplayOn) AND StartDate <= '$currdate' AND EndDate >= '$currdate' ORDER BY RAND()";
$rs_data = mysql_query($sql_query) or die ("could not execute query: " . mysql_error());
while($data = mysql_fetch_assoc($rs_data))
{
$arr_data[$data['DisplayOrder']] = $data;
}
ksort($arr_data);
foreach($arr_data as $item)until I changed my table structure by adding a new field into my table called "displayOn" this field is causing an error on the page if there is not value in the field. Here is the error
Warning: ksort() expects parameter 1 to be array, null given in /usr/local/apache.....
Warning: Invalid argument supplied for foreach() .....
can anyone plaese help? much appreciated!
paulng.