daily pastebin goal
37%
SHARE
TWEET

Untitled

a guest Jan 12th, 2018 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // GET FMCSA TAKES OVER 50 seconds..... i even try to use cache
  2.     // Get FMCSA Data
  3.     function GetFMCSA($type, $number)
  4.     {
  5.         $this->db = $this->load->database('facsa_db', TRUE); // Use Database
  6.         $this->db->cache_on();
  7.         // Run Query
  8.         $query = NULL;
  9.         if ($type == 'mc') { $query = $this->db->get_where('data_fmcsa', array('docket_number' => $number)); }
  10.         else { $query = $this->db->get_where('data_fmcsa', array('usdot' => $number), 1); }
  11.  
  12.         // Return Data
  13.         if ($query->num_rows() >= 1) {
  14.             foreach ($query->result() as $row) { $data[] = $row; }
  15.             return $data[0];
  16.         }
  17.         $this->db->cache_off();
  18.         return FALSE;
  19.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top