Error Number 1096 Codeigniter
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this error number 1054 in codeigniter site About Us Learn more about Stack Overflow the company Business Learn more
Error Number 1146 In Codeigniter
about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x error number 1064 codeigniter 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 MYSQL ERROR
Error Number 1048 Codeigniter
1096 - NO TABLES USED - CODEIGNITER up vote 1 down vote favorite I am using a custom query as the Active Record equivelant did not work for me. When placing the Query in my Database Software SQLYOG it works fine however in CodeIgniter it says A Database Error Occurred Error Number: 1096 No tables used SELECT * Filename: C:\xampp\htdocs\midas\system\database\DB_driver.php Line Number: 330 Here is error number 1062 codeigniter my 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 It is a bit of a strange problem. Here is my Schema also: http://i.imgur.com/mKNtc.png php mysql database codeigniter share|improve this question asked Aug 3 '11 at 14:17 sqlmole 40741327 I don't think it's the posted query thats causing the error. –Jacob Aug 3 '11 at 14:20 Can you show the code that you build the query? –Alfonso Rubalcava Aug 3 '11 at 14:58 add a comment| 3 Answers 3 active oldest votes up vote 1 down vote accepted EDIT This will not work. As noted below only COUNT(*) or COUNT(table.field) work. I think you need to specify which table you are using COUNT(*) on, so change it to something like COUNT(department.*) or COUNT(intervention.*) share|improve this answer edited Aug 3 '11 at 14:38 answered Aug 3 '11 at 14:22 Hunter McMillen 27k867125 That now gives me a Syntax error: Error Number: 1064 –sqlmole Aug 3 '11 at 14:25 @Hunter: You have to either count on a specific field (count(table
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss
Error 1096 Mysql
the workings and policies of this site About Us Learn more
No Tables Used Codeigniter
about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack codeigniter custom query 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 http://stackoverflow.com/questions/6927940/mysql-error-1096-no-tables-used-codeigniter each other. Join them; it only takes a minute: Sign up CodeIgniter MySQL query not working up vote 4 down vote favorite 1 I'm trying to get this query to work in CodeIgniter but it's spitting out an error: A Database Error Occurred Error Number: 1096 No tables used SELECT * If I put the query directly into http://stackoverflow.com/questions/4839038/codeigniter-mysql-query-not-working MySQL it works fine (I replace the $variables with values). Here is the query as input into codeigniter: $this->db->query(" SELECT * FROM writing_quests LEFT OUTER JOIN members_quests_completed ON members_quests_completed.quest_id = writing_quests.id WHERE writing_quests.level_required <= $userlevel AND ( members_quests_completed.user_id = $user_id OR members_quests_completed.user_id IS NULL )" ); $query = $this->db->get(); Am I doing something that is wrong and I am missing it? I've included the while function call in case the problem is somewhere else? I've done this exact thing many times without an issue. function get_all_quests_for_user() { $user_id = $this->session->userdata('user_id'); $userlevel = $this->session->userdata('user_level'); $this->db->query("SELECT writing_quests.id, writing_quests.points_availible, writing_quests.name, writing_quests.note, writing_quests.instructions, writing_quests.time_limit, members_quests_completed.location_completed, members_quests_completed.status FROM writing_quests LEFT OUTER JOIN members_quests_completed ON members_quests_completed.quest_id = writing_quests.id WHERE writing_quests.level_required <= '$userlevel' AND writing_quests.unlocked = 1 AND ( members_quests_completed.user_id = '$user_id' OR members_quests_completed.user_id IS NULL )"); $query = $this->db->get(); $this->db->last_query(); return $query->result(); } php mysql codeigniter activerecord share|improve this question edited Jan 29 '11 at 20:22 asked Jan 29 '11 at 19:47 JoeM05 3941422 1 Perhaps CI's query() method doesn't like line breaks. –BoltClock♦ Jan 29
up log in tour help Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might http://expressionengine.stackexchange.com/questions/23922/error-1096-no-tables-used-codeigniter have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us ExpressionEngine® Answers Questions Tags Users Badges Unanswered Ask Question _ ExpressionEngine® Answers is a question and answer site for administrators, end users, developers and designers error number for ExpressionEngine® CMS. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top Error 1096 - No Tables Used - CodeIgniter up vote 0 down vote favorite I am trying to use one of error number 1096 stores hooks to insert data into the database when displaying the success page after paying online for an order and I get the following error: Error Number: 1096 No tables used SELECT * This is the function I am calling on the store_order_complete_end hook from store: public function store_order_complete_end($member_id) { // hook try { // generate coupon code $coupon_code = 'FLK-' . mt_rand(100000000, 999999999); // generate coupon code until code is unique while ($this->check_coupon($coupon_code)) { $coupon_code = 'FLK-' . mt_rand(100000000, 999999999); } //----------------------------------------------------- // -- inserting into table exp_channel_titles -- // retrieving the next available primary key value $entry_id = ee()->db->insert_id(); // array containing the data that will be inserted into the database $titles = array( 'entry_id' => $entry_id, 'site_id' => 1, 'channel_id' => 8, 'author_id' => $member_id, 'ip_address' => null, 'title' => $coupon_code, 'url_title' => strtolower($coupon_code), 'status' => 'open', 'entry_date' => strtotime('now') ); // insert coupon into table exp_channel_titles ee()->db->insert('exp_channel_titles', $titles); //----------------------------------------------------- //----------------------------------------------------- // -- inserting into table exp_channel_data -- // array containi