|
|
|
@ -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;
|
|
|
|
|
$sql = 'INSERT wochen_ware SET item='.$fruits[$choice]['id'].', user='.$user_id;
|
|
|
|
|
echo $sql . '<br>';
|
|
|
|
|
mysql_query($sql);
|
|
|
|
|
}
|
|
|
|
|
?>
|