Advertisement
Guest User

codeigniter

a guest
Dec 14th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.12 KB | None | 0 0
  1. // MINHA MY MODEL -------------
  2.  
  3. <?php
  4.  
  5. class MY_Model extends CI_Model
  6. {
  7.  
  8. protected $db2;
  9.  
  10. public function __construct() {
  11.  
  12. parent::__construct();
  13. $this->connect();
  14. }
  15.  
  16.  
  17. public function __destruct() {
  18.  
  19. $this->db->close();
  20. }
  21.  
  22. public function connect(){
  23.  
  24. $second = array(
  25. 'dsn' => '',
  26. 'hostname' => 'localhost',
  27. 'username' => 'root',
  28. 'password' => '',
  29. 'database' => 'nomebanco',
  30. 'dbdriver' => 'mysqli',
  31. 'dbprefix' => '',
  32. 'pconnect' => FALSE,
  33. 'db_debug' => (ENVIRONMENT !== 'production'),
  34. 'cache_on' => FALSE,
  35. 'cachedir' => '',
  36. 'char_set' => 'utf8',
  37. 'dbcollat' => 'utf8_general_ci',
  38. 'swap_pre' => '',
  39. 'encrypt' => FALSE,
  40. 'compress' => FALSE,
  41. 'stricton' => FALSE,
  42. 'failover' => array(),
  43. 'save_queries' => TRUE
  44. );
  45.  
  46. $this->db2 = $this->load->database( $second );
  47. }
  48.  
  49. }
  50.  
  51.  
  52.  
  53. // MINHA MODEL EXTENDS MY MODEL --------------------
  54.  
  55. class Schedule_model extends MY_Model{
  56.  
  57.  
  58. public function __construct()
  59. {
  60. parent::__construct();
  61. }
  62.  
  63.  
  64.  
  65.  
  66.  
  67. /**
  68. * ------------------------------------------------------------------------------------------
  69. * Function select plan related to user id
  70. * ------------------------------------------------------------------------------------------
  71. *
  72. * @var strings
  73. * @param $idClient
  74. *
  75. */
  76.  
  77. public function listQueryRequests( $idClient )
  78. {
  79.  
  80. return $this->db2->select( '*' )->from( 'tbl_schedule_temporary' )
  81.  
  82. ->where( 'id_client_system', $idClient )->where('check_flag IN( 0, 1 )' )
  83.  
  84. ->get()->result();
  85.  
  86.  
  87. }
  88.  
  89. AĆ­ da esse erro
  90. Message: Call to a member function select() on boolean
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement