Guest User

Untitled

a guest
Jan 22nd, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. TABLE: 'config'
  2.  
  3. id c_key c_value
  4. 1 facebook a:1:{i:0;s:8:"Newsfeed";}
  5. 2 mg_notification_msv to.aaaa.org
  6.  
  7. public function db_get_config($key, $default = null)
  8. {
  9. if (!empty($key)) {
  10. // $record = $this->db_get_record($this->tables['config'], array('c_key' => $key));
  11. $record = $this->db->from($this->tables['config'])->where(array('c_key' => $key))->limit(1)->get()->row_array();
  12. if (!empty($record)) {
  13. $value = unserialize($record['c_value']); // Message: unserialize(): Error at offset 0 of 15 bytes
  14. if ($value === false) {
  15. $value = $record['c_value'];
  16. }
  17. return $value;
  18. }
  19. }
  20.  
  21. return $default;
  22. }
Add Comment
Please, Sign In to add comment