Vergleich inc/functions_user.php - 1.8.0 - 1.8.1

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 672Zeile 672
{
global $db;


{
global $db;


	$query = $db->query("
SELECT qid, shown
FROM ".TABLE_PREFIX."questions
WHERE active='1'
ORDER BY RAND()
LIMIT 1
");




	if($db->type == 'pgsql' || $db->type == 'sqlite')
{
$order_by = 'RANDOM()';
}
else
{
$order_by = 'RAND()';
}

$query = $db->simple_select('questions', 'qid, shown', 'active=1', array('limit' => 1, 'order_by' => $order_by));

	$question = $db->fetch_array($query);

if(!$db->num_rows($query))

	$question = $db->fetch_array($query);

if(!$db->num_rows($query))