Public paste
Undefined
By: Guest | Date: Oct 8 2008 21:48 | Format: PHP | Expires: never | Size: 400 B | Hits: 1232

  1. <?php
  2.  
  3. $obj=mysql_query("SELECT * FROM bloem_actie");
  4. while ($info = mysql_fetch_array($obj)) {
  5.         $product[$info['product']][] = $info['id'];
  6. }
  7.  
  8. $obj=mysql_query("SELECT * FROM bloem_product GROUP BY id") or die(mysql_error());
  9. while($info = mysql_fetch_array($obj)){
  10.    $chosen = array_rand($product[$info['id']], 1);
  11.    echo $chosen." has won for product".$product[$info['id']];
  12. }
  13.  
  14. ?>