neue Turniere: Cronjobs implementiert

main
hecht 8 years ago
parent 6d2a4fee48
commit 3652c64d51

@ -21,4 +21,20 @@ function distributeFruit($user_id) {
echo $sql . '<br>'; echo $sql . '<br>';
mysql_query($sql); mysql_query($sql);
} }
?>
function distributeParamecia($user_id) {
$sql = 'SELECT id FROM wochen_markt WHERE kategorie=\'Paramecia\'';
$qry = mysql_query($sql);
$amount = mysql_num_rows($qry);
while($fruit = mysql_fetch_assoc($qry)) {
$fruits[] = $fruit;
}
$choice = mt_random_wrapper(0,$amount-1);
$sql = 'INSERT wochen_ware SET item='.$fruits[$choice]['id'].', user='.$user_id;
echo $sql . '<br>';
mysql_query($sql);
}
?>

Loading…
Cancel
Save