Error Number 1096 No Tables Used
Contents |
here for a
No Tables Used Codeigniter
quick overview of the site Help Center Detailed error 1096 mysql answers to any questions you might have Meta Discuss the workings and
Codeigniter Error Number 1096
policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or codeigniter custom query 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('t
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 department ON department.department_id = intervention.department_id
GROUP BY intervention.department_id, department.department_name
ORDER BY COUNT(*) DESC
http://stackoverflow.com/questions/22854551/error-number-1096-error-number-1096-no-tables 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
ORDER BY COUNT(*) desc
LIMIT 1
");
$result =$this->db->get(); The error message I am getting: Quote:A Database Error http://forum.codeigniter.com/thread-44107.html 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. $this->db->get() is part of active record, and can be used in conjunction with select(), where(), limit(), etc. I'd recommend using the normal query() method for most queries, unless you intend on distributing your application for use with more than one type of database. Active record can be handy, but it has its limitation
Sign in Pricing Blog Support Search GitHub This repository Watch 153 https://github.com/ci-bonfire/Bonfire/issues/839 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 http://www.4answered.com/questions/view/dbffbb/I-can39t-query-database-on-model used. Trying to enter admin area after install #839 Closed denis-gorin opened this Issue Jul 2, 2013 · 2 comments Projects None yet error number 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 error number 1096 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 … Forg
: user1993418 Source: Stackoverflow.com Question! By : user1993418 Related Questions Video about I can't query database on model About Us Contact Us Legal feedback Copyright © 2015 - All Rights Reserved - www.4answered.com