From bc99599f64c84a12a3cef992e303fd885726ed71 Mon Sep 17 00:00:00 2001 From: hecht Date: Tue, 6 Sep 2011 18:48:44 +0000 Subject: [PATCH] fix!! Hall Of Fame + Frucht sollte nun gehen ;) --- cronjob/inclu/fruitdistribution.inc.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cronjob/inclu/fruitdistribution.inc.php b/cronjob/inclu/fruitdistribution.inc.php index e3b264c..44dd29b 100644 --- a/cronjob/inclu/fruitdistribution.inc.php +++ b/cronjob/inclu/fruitdistribution.inc.php @@ -9,14 +9,14 @@ function distributeFruit($user_id) { $sql = 'SELECT id FROM wochen_markt WHERE art=\'natur\''; $qry = mysql_query($sql); - $amount = mysql_affected_rows($qry); + $amount = mysql_num_rows($qry); while($fruit = mysql_fetch_assoc($qry)) { $fruits[] = $fruit; } $choice = mt_rand(0,$amount-1); - $sql = 'INSERT wochen_ware SET item='.$fruits[$choice].', user='.$user_id; - echo $sql; - mysql_query($sql); + $sql = 'INSERT wochen_ware SET item='.$fruits[$choice]['id'].', user='.$user_id; + echo $sql . '
'; + mysql_query($sql); } ?> \ No newline at end of file