Advertisement
Guest User

Untitled

a guest
Jun 19th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.66 KB | None | 0 0
  1. <?php
  2.  
  3.     $stats = array();
  4.     for($i = 1; $i <= 12; $i++) {
  5.         $stats[$i] = retrieveStats('orange/actualite', '2010', '10'));
  6.         if ($stats[$i] === false) {
  7.             $stats[$i] = array(
  8.                 'un' => 123,
  9.                 'deux' => 234,
  10.                 'trois' => 345,
  11.             );
  12.             storeStats('orange/actualite', '2010', '10', $stats[$i]);
  13.         }
  14.     }
  15.    
  16.     function storeStats($section_name, $year, $month, $stats) {
  17.         foreach ($stats as $stats_name => $stats_value) {
  18.             $this->db->insert('stats_orange', array(
  19.                 'section_name' => $section_name,
  20.                 'month'        => $month,
  21.                 'year'         => $year,
  22.                 'stats_name'   => $stats_name,
  23.                 'stats_value'  => $stats_value,
  24.             );
  25.         }
  26.     }
  27. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement