Error Number 1096
Contents |
here for a quick overview of error 1096 mysql the site Help Center Detailed answers to any
No Tables Used Codeigniter
questions you might have Meta Discuss the workings and policies of this site About codeigniter custom query Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error Number: 1096 Error Number: 1096 No tables up vote -1 down vote favorite class model_trans_gc extends CI_Model{ function trans_gc_add() { $add=array( 'trans_gc_date' => $this->input->post('trans_gc_date'), 'trans_gc_no' => $this->input->post('trans_gc_no'), 'trans_gc_consname' => $this->input->post('trans_gc_consname'), 'trans_gc_consbank' => $this->input->post('trans_gc_consbank'), 'trans_gc_consname_add' => $this->input->post('trans_gc_consname_add'), 'trans_gc_consbank_add' => $this->input->post('trans_gc_consbank_add'), 'trans_gc_comp' => $this->input->post('trans_gc_comp'), 'trans_gc_pol' => $this->input->post('trans_gc_pol'), 'trans_gc_amt' => $this->input->post('trans_gc_amt'), 'trans_gc_insdate' => $this->input->post('trans_gc_insdate'), 'trans_gc_risk' => $this->input->post('trans_gc_risk'), 'trans_gc_from' => $this->input->post('trans_gc_from'), 'trans_gc_to' => $this->input->post('trans_gc_to'), 'trans_gc_packno' => $this->input->post('trans_gc_packno'), 'trans_gc_packdesc' => $this->input->post('trans_gc_packdesc'), 'trans_gc_actweight' => $this->input->post('trans_gc_actweight'), 'trans_gc_charweight' => $this->input->post('trans_gc_charweight'), 'trans_gc_method_pack' => $this->input->post('trans_gc_method_pack'), 'trans_gc_frt' => $this->input->post('trans_gc_frt'), 'trans_gc_hamali' => $this->input->post('trans_gc_hamali'), 'trans_gc_sr' => $this->input->post('trans_gc_sr'), 'trans_gc_aoc' => $this->input->post('trans_gc_aoc'), 'trans_gc_doorcln' => $this->input->post('trans_gc_doorcln'), 'trans_gc_doordel' => $this->input->post('trans_gc_doordel'), 'trans_gc_riskch' => $this->input->post('trans_gc_riskch'), 'trans_gc_dem' => $this->input->post('trans_gc_dem'), 'trans_gc_gc' => $this->input->post('trans_gc_gc'), 'trans_gc_total' => $this->input->post('trans_gc_total'), 'trans_gc_paymode' => $this->input->post('trans_gc_paymode'), 'trans_gc_crno' => $this->input->post('trans_gc_crno'), 'status' => '1' ); $this->db->insert('trans_gc_add',$add); $query=$this->db->get(); return $query->result(); } } Database Error Occurred Error Number: 1096 No tables used SELECT * Filename: C:\xampp\htdo
ERROR 1096 - NO TABLES USED - CODEIGNITER Thread Closed 0 Vote(s) - 0 Average 1 2 3 4 5 Thread Modes [solved]MYSQL ERROR 1096 - NO TABLES USED - CODEIGNITER El Forum Unregistered #1 08-03-2011, 09:23 AM [eluser]brucebat[/eluser] Hi all, Here is my Query which works fine in PHPMyAdmin and SQLYOG Code: SELECT intervention.department_id, department_name, COUNT(*)
FROM intervention
LEFT JOIN http://stackoverflow.com/questions/22854551/error-number-1096-error-number-1096-no-tables department ON department.department_id = intervention.department_id
GROUP BY intervention.department_id, department.department_name
ORDER BY COUNT(*) DESC
LIMIT 1 The Query + Code: Code: $this->db->query("
SELECT intervention.department_id, department_name, COUNT(*)
FROM intervention
LEFT JOIN department ON department.department_id = intervention.department_id
GROUP BY intervention.department_id, department.department_name
http://forum.codeigniter.com/thread-44107.html /> ORDER BY COUNT(*) desc
LIMIT 1
");
$result =$this->db->get(); The error message I am getting: Quote:A Database Error Occurred Error Number: 1096 No tables used SELECT * Filename: C:\xampp\htdocs\midas\system\database\DB_driver.php Line Number: 330 El Forum Unregistered #2 08-03-2011, 10:23 AM [eluser]Wondering Coder[/eluser] don't see you returning your query. also add a second parameter FALSE in your query. El Forum Unregistered #3 08-03-2011, 10:39 AM [eluser]brucebat[/eluser] Thanks I managed to figure it out. It should have been : Code: $result = $this->db->query(); As the query is executed automatically without get() statement then when I was callign the get statement it had no values or parameters hence why it said "No Tables Found" El Forum Unregistered #4 08-04-2011, 03:45 AM [eluser]Aken[/eluser] Bingo. $this->db->query() is NOT an active record function, and is meant to be used by itself. $t
forgot password? This is an archived forum and may no longer be relevant. The active forums are here. Advanced Search Error 1096 - https://ellislab.com/forums/archive/viewthread/220524 No tables Used Scott Jones Posted: 09 July 2012 https://github.com/ci-bonfire/Bonfire/issues/839 07:41 AM Joined: 2012-07-092 posts Hi All, Im getting the above MYSQL error when trying to use active records within an EE 2.x module and i can understand why, my code is as follows: //build select statement $this->EE->db->select("DISTINCT t.tour_internal_id AS Tour_ID, error number t.tour_depart AS tour_Depart, i.itinerary_internal_id Itinerary_ID, i.itinerary_depart Depart_UK, i3.itinerary_arrive Arrive_UK, t.tour_headline_price Price, s.supplier_name Supplier_Name, t.tour_status AS Tour_Status, t.tour_master_code as Tour_Master_Code, i.itinerary_restricted AS Restricted", FALSE); //build from and join clauses $this->EE->db->from("tour AS t"); $this->EE->db->join("itinerary AS i", "i.itinerary_tour_id = t.tour_internal_id AND i.itinerary_out = 1 AND i.hguid = '{$this->hguid}' AND i.itinerary_type in ('Flight', 'Eurostar', 'Rail') error number 1096 AND i.itinerary_name = '{$depPoint}' AND i.itinerary_availability >= {$numPax} AND i.itinerary_cid = {$company}"); $this->EE->db->join("itinerary AS i2", "i2.itinerary_tour_id = t.tour_internal_id AND i2.hguid = '{$this->hguid}' AND i2.itinerary_type ='Accomodation' AND i2.itinerary_availability >= {$numPax} AND i2.itinerary_max_occupance <= {$numPax} AND i2.itinerary_cid = {$company}"); $this->EE->db->join("supplier AS s", "s.supplier_internal_id = i2.itinerary_supplier_id AND s.hguid = '{$this->hguid}' {$riverCruise}"); $this->EE->db->join("itinerary AS i3", "i3.itinerary_link_id = i.itinerary_internal_id AND i3.itinerary_out <> 1 and i3.hguid = '{$this->hguid}' AND i3.itinerary_type in ('Flight', 'Eurostar') AND i3.itinerary_cid = {$company}", "Left"); //build where statement $this->EE->db->where("t.tour_master_code", $tourCode); $this->EE->db->where("t.hguid", $this->hguid); $this->EE->db->where("t.tour_cid", $company); //build order by clause $this->EE->db->order_by("t.tour_depart", "ASC"); $this->EE->db->order_by("i.itinerary_depart", "ASC"); $this->EE->db->order_by("i3.itinerary_arrive", "DESC"); $this->EE->db->order_by("s.supplier_name", "ASC"); //set distinct //$this->EE->db->distinct(); //get results $query = $this->EE->db->get(); the error is: Error Number: 1096 No tables used SELECT * Filename: C:\Users\Scott.Jones\Google Drive\workspace\riv-web-new\system\codeigniter\system\database\DB_driver.php Line Number: 330 I have looked around and from what i can see its usually a COUNT or SUM that causes this, however i am not using either.. Any help is much appreciated as I have racked
Sign in Pricing Blog Support Search GitHub This repository Watch 153 Star 1,351 Fork 547 ci-bonfire/Bonfire Code Issues 96 Pull requests 4 Projects 0 Wiki Pulse Graphs New issue Error Number: 1096 No tables used. Trying to enter admin area after install #839 Closed denis-gorin opened this Issue Jul 2, 2013 · 2 comments Projects None yet Labels None yet Milestone No milestone Assignees No one assigned 2 participants denis-gorin commented Jul 2, 2013 bonfire\modules\settings\models\settings_model.php line 40 protected $table_name = 'settings'; changed to protected $_table = 'settings'; fix the problem denis-gorin commented Jul 2, 2013 wrong approach. better workaround: in application\core\MY_Model.php define protected $table_name = ''; then in constructor $this->_table = $this->table_name; CI Bonfire member mwhitneysdsu commented Jul 2, 2013 Sorry, that one was my fault. I should have MY_Model updated to change the instances of $this->_table to $this->table_name shortly, github for Windows isn't being very cooperative at the moment. mwhitneysdsu added a commit that closed this issue Jul 2, 2013 mwhitneysdsu #839 … Forgot to include change to MY_Model after updating the $_table variable name in all of the models de6436b mwhitneysdsu closed this in