fix!! Hall Of Fame + Frucht sollte nun gehen ;)

main
hecht 13 years ago
parent b78b951d65
commit bc99599f64

@ -9,14 +9,14 @@
function distributeFruit($user_id) { function distributeFruit($user_id) {
$sql = 'SELECT id FROM wochen_markt WHERE art=\'natur\''; $sql = 'SELECT id FROM wochen_markt WHERE art=\'natur\'';
$qry = mysql_query($sql); $qry = mysql_query($sql);
$amount = mysql_affected_rows($qry); $amount = mysql_num_rows($qry);
while($fruit = mysql_fetch_assoc($qry)) { while($fruit = mysql_fetch_assoc($qry)) {
$fruits[] = $fruit; $fruits[] = $fruit;
} }
$choice = mt_rand(0,$amount-1); $choice = mt_rand(0,$amount-1);
$sql = 'INSERT wochen_ware SET item='.$fruits[$choice].', user='.$user_id; $sql = 'INSERT wochen_ware SET item='.$fruits[$choice]['id'].', user='.$user_id;
echo $sql; echo $sql . '<br>';
mysql_query($sql); mysql_query($sql);
} }
?> ?>
Loading…
Cancel
Save