Welcome Guest, Not a member yet? Register   Sign In
[solved]MYSQL ERROR 1096 - NO TABLES USED - CODEIGNITER
#1

[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
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 Occurred

Error Number: 1096

No tables used

SELECT *

Filename: C:\xampp\htdocs\midas\system\database\DB_driver.php

Line Number: 330


Messages In This Thread
[solved]MYSQL ERROR 1096 - NO TABLES USED - CODEIGNITER - by El Forum - 08-03-2011, 08:23 AM
[solved]MYSQL ERROR 1096 - NO TABLES USED - CODEIGNITER - by El Forum - 08-03-2011, 09:23 AM
[solved]MYSQL ERROR 1096 - NO TABLES USED - CODEIGNITER - by El Forum - 08-03-2011, 09:39 AM
[solved]MYSQL ERROR 1096 - NO TABLES USED - CODEIGNITER - by El Forum - 08-04-2011, 02:45 AM



Theme © iAndrew 2016 - Forum software by © MyBB