![]() |
Trying to get property of non-object - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Trying to get property of non-object (/showthread.php?tid=27891) |
Trying to get property of non-object - El Forum - 02-23-2010 [eluser]Shaileen[/eluser] Controller : <?php class T1_orders_active extends MY_Controller { function index() { $this->load->model('steve', '', true); $this->load->model('t1_orders_active_model', '', true); $username = $this->session->userdata('$username'); $data['username'] = $username; $data['title'] = "T1 Order Tracking"; $data['subtitle'] = "List Active Orders"; $this->load->view('header_main', $data); $this->load->view('showmenu', $data); $this->load->view('t1_orders_active_view',$data); $this->load->view('footer_main'); $this->load->helper('cookie'); $AUTH = $this->steve->get_menu($username); if($AUTH->tick28 == 1) { $inyc_limit = " AND inyc = 1"; } else { $inyc_limit = ""; } if($AUTH->tick2 == 1) { $this->t1_orders_active_model->one(); } elseif($AUTH->tick2 == 2) { $this->t1_orders_active_model->two(); } elseif($AUTH->tick2 == 3) { $this->t1_orders_active_model->three(); } if($tt_exist) { $tt_link = "<a href='dsl_tt_list.php?searchText=$refid'><img src='$c{url}{public_images}/tt_open.gif' border='0'></a>"; } else { $tt_link = "<a href='dsl_tt_list.php?searchText=$refid'><img src='$c{url}{public_images}/tt_none.gif' border='0'></a>"; } } } model : <?php class T1_orders_active_model extends Model { function T1_orders_active() { // Call the Model constructor parent::Model(); } function one() { $this->db->select('mydsl_auth.username, t1_admin.refid, t1_admin.admin_date_activated, t1_eu.eu_company, t1_eu.eu_contact, t1_admin.quote_id, t1_order.main_email, t1_order.bandwidth_id'); $this->db->from('mydsl_auth, t1_admin, t1_eu, t1_order '); $this->db->where('t1_admin.admin_active =', '1'); $this->db->where('t1_admin.admin_deleted =', '0'); $this->db->where('t1_admin.admin_cancelled =', '0'); $this->db->where('t1_admin.admin_order_sent =','1'); $this->db->where('t1_eu.seqid = t1_admin.refid'); $this->db->where('mydsl_auth.user_id = t1_admin.salesperson'); $this->db->where('order.refid = t1_eu.seqid '); $this->db->where('t1_admin.salesperson = $AUTH[1] $inyc_limit'); $find_admin = $this->db->get(); return $find_admin; } function two() { $this->db->select('mydsl_auth.username, t1_admin.refid, t1_admin.admin_date_activated, t1_eu.eu_company, t1_eu.eu_contact, t1_admin.quote_id, t1_order.main_email, t1_order.bandwidth_id '); $this->db->from('mydsl_auth, t1_admin, t1_eu, t1_order '); $this->db->where('t1_admin.admin_active =', '1'); $this->db->where('t1_admin.admin_deleted =', '0'); $this->db->where('t1_admin.admin_cancelled =', '0'); $this->db->where('t1_admin.admin_order_sent =','1'); $this->db->where('t1_eu.seqid = t1_admin.refid'); $this->db->where('mydsl_auth.user_id = t1_admin.salesperson'); $this->db->where('t1_order.refid = t1_eu.seqid'); $this->db->where('t1_admin.salesperson = $AUTH[1]$inyc_limit'); $this->db->or_where('mydsl_auth.agent_manager = $AUTH[1]) $inyc_limit'); $find_admin = $this->db->get(); return $find_admin; } function three() { $this->db->select('mydsl_auth.username, t1_admin.refid, t1_admin.admin_date_activated, t1_eu.eu_company, t1_eu.eu_contact, t1_admin.quote_id, t1_order.main_email, t1_order.bandwidth_id'); $this->db->from('mydsl_auth, t1_admin, t1_eu, t1_order'); $this->db->where('t1_admin.admin_active =', '1'); $this->db->where('t1_admin.admin_deleted =', '0'); $this->db->where('t1_admin.admin_cancelled =', '0'); $this->db->where('t1_admin.admin_order_sent =','1'); $this->db->where('t1_eu.seqid = t1_admin.refid'); $this->db->where('t1_order.refid = t1_eu.seqid'); $this->db->where('mydsl_auth.user_id = t1_admin.salesperson $inyc_limit'); $find_admin = $this->db->get(); return $find_admin; } function tt_exist($quote_id) { $this->db->count_all_results('dsl_tt'); $this->db->where('order_id','$quote_id'); $this->db->where('resloved', 0); $query = $this->db->get(); return $query; } } Please help me to fix the following errors : A PHP Error was encountered Severity: Notice Message: Trying to get property of non-object Filename: controllers/t1_orders_active.php Line Number: 21 A PHP Error was encountered Severity: Notice Message: Trying to get property of non-object Filename: controllers/t1_orders_active.php Line Number: 30 A PHP Error was encountered Severity: Notice Message: Trying to get property of non-object Filename: controllers/t1_orders_active.php Line Number: 36 A PHP Error was encountered Severity: Notice Message: Trying to get property of non-object Filename: controllers/t1_orders_active.php Line Number: 42 Trying to get property of non-object - El Forum - 02-23-2010 [eluser]heavenquake[/eluser] $AUTH = $this->steve->get_menu($username); Here: $AUTH becomes something other than an object. That might be because steve->get_menu() returns FALSE or perhaps an array. var_dump($AUTH); and find out what it is, and fix the error. Trying to get property of non-object - El Forum - 02-23-2010 [eluser]Shaileen[/eluser] Hi, I got array (0) {} I have no idea what this is. I am new to PHP and Codeignitor.. Trying to get property of non-object - El Forum - 02-23-2010 [eluser]Christopher Blankenship[/eluser] Just took a quick look at it so correct me if I am wrong here but you are trying to get $AUTH from inside the model, is $AUTH a global. line 21 of your controller states "$this->db->where(‘t1_admin.salesperson = $AUTH[1] $inyc_limit’);" but I don't see $AUTH being passed to it, just as you are passing your $quote_id in the tt_exist function of your model. Trying to get property of non-object - El Forum - 05-31-2012 [eluser]Unknown[/eluser] A PHP Error was encountered Severity: Notice Message: Trying to get property of non-object Filename: controllers/main.php Line Number: 3090 A PHP Error was encountered Severity: Notice Message: Trying to get property of non-object Filename: controllers/main.php Line Number: 3096 A PHP Error was encountered Severity: Notice Message: Trying to get property of non-object Filename: controllers/main.php Line Number: 3097 A PHP Error was encountered Severity: Notice Message: Trying to get property of non-object Filename: controllers/main.php Line Number: 3098 A PHP Error was encountered Severity: Notice 1/5 Message: Trying to get property of non-object Filename: controllers/main.php Line Number: 3099 A PHP Error was encountered Severity: Notice Message: Trying to get property of non-object Filename: controllers/main.php Line Number: 3100 A PHP Error was encountered Severity: Notice Message: Trying to get property of non-object Filename: controllers/main.php Line Number: 3101 A PHP Error was encountered Severity: Notice Message: Trying to get property of non-object Filename: controllers/main.php Line Number: 3102 A PHP Error was encountered Severity: Notice Message: Trying to get property of non-object Filename: controllers/main.php Line Number: 3103 2/5 A PHP Error was encountered Severity: Notice Message: Trying to get property of non-object Filename: controllers/main.php Line Number: 3104 A PHP Error was encountered Severity: Notice Message: Trying to get property of non-object Filename: controllers/main.php Line Number: 3105 A PHP Error was encountered Severity: Notice Message: Trying to get property of non-object Filename: controllers/main.php Line Number: 3106 A PHP Error was encountered Severity: Notice Message: Trying to get property of non-object Filename: controllers/main.php Line Number: 3107 A PHP Error was encountered Severity: Notice Message: Trying to get property of non-object Filename: controllers/main.php 3/5 Line Number: 3108 A PHP Error was encountered Severity: Notice Message: Trying to get property of non-object Filename: controllers/main.php Line Number: 3109 A PHP Error was encountered Severity: Notice Message: Undefined variable: fee Filename: controllers/main.php Line Number: 3153 I intend to pay by credit card and herewith authorize WREEEC to charge the amount below as stated on the invoice number : Total amount : USD 0 By Card holder name : ........................................................................ Card number : ........................................................................ Security number : .................... Expiration Date : .................................................. (month/year) Billing Address : ........................................................................ 4/5 ........................................................................ ........................................................................ City : ........................................................................ Zip Code : .................... Country : ........................................................................ Telephone : ........................................................................ Fax Number : ........................................................................ By signing this form I agree that all information provided is accurate and complete. I have read and agreed to the disclaimer of liability posted on the 9th APMCE website and agreed to abide by decisions of the 9th APMCE secretariat or persons entrusted by the committee, with respect to operation of the conference and exhibition. Card holder signature : ........................................... Date : .................... NOTE - Payment by credit card is normally charged in local curency. The committee takes no responsibilty for subsequent exchange rates applied by credit card vendors when your statement is converted into local currency. - Please fax this form to +62-21 5705798 together with copy of your credit card (both side) 5/5 I have find some document about this problem . However i can't fix this problem , can you help me !!! Trying to get property of non-object - El Forum - 05-31-2012 [eluser]Abel A.[/eluser] Use the correct forum. Use the code tags. |