Welcome Guest, Not a member yet? Register   Sign In
Database trouble - Error Number: 1096
#8

[eluser]coldKingdom[/eluser]
Now i have done a complete fresh installation of 1.6.1 with no addons or anything activated besides the database library and on a different server.

welcome.php - Controller

Code:
<?php
class Welcome extends Controller {

    function Welcome()
    {
        parent::Controller();    
    }
    
    function index()
    {
        $this->load->model('Gallery');
        $data['query'] = $this->Gallery->get_last_ten_entries();

        $this->load->view('welcome_message', $data);
    }
}
?>

Gallery.php - Model

Code:
<?php
class Gallery extends Model {

    function Gallery()
    {
        // Call the Model constructor
        parent::Model();
    }
    
    function get_last_ten_entries()
    {
        $this->db->select("gallery_picture");
        $this->db->from('tbl_gallery');
        
        $total = $this->db->count_all_results(); //Without this it works perfectly
        
        $query = $this->db->get();
        
        return $query->result();
    }
}
?>

welcome.php - View

Code:
<html>
<head>
<title>Welcome to CodeIgniter</title>
</head>
<body>

<?php
    foreach($query as $item):
        print $item->gallery_picture.'<br /><br />';
    endforeach;
?&gt;

&lt;/body&gt;
&lt;/html&gt;

Error message from CodeIgniter 1.6.1

Quote:An Error Was Encountered
Error Number: 1096

No tables used

SELECT *

I don't know really what more i can do to make it easier. I can test 1.6.0 if you wan't me to.

Edit: Just tested 1.6.0 with the same error


Messages In This Thread
Database trouble - Error Number: 1096 - by El Forum - 02-24-2008, 08:21 PM
Database trouble - Error Number: 1096 - by El Forum - 02-24-2008, 08:31 PM
Database trouble - Error Number: 1096 - by El Forum - 02-25-2008, 02:27 AM
Database trouble - Error Number: 1096 - by El Forum - 02-25-2008, 07:23 AM
Database trouble - Error Number: 1096 - by El Forum - 02-25-2008, 07:36 AM
Database trouble - Error Number: 1096 - by El Forum - 02-25-2008, 07:38 AM
Database trouble - Error Number: 1096 - by El Forum - 02-25-2008, 08:07 AM
Database trouble - Error Number: 1096 - by El Forum - 02-26-2008, 09:03 AM
Database trouble - Error Number: 1096 - by El Forum - 02-26-2008, 09:13 AM
Database trouble - Error Number: 1096 - by El Forum - 02-26-2008, 09:31 AM
Database trouble - Error Number: 1096 - by El Forum - 11-26-2008, 09:16 AM
Database trouble - Error Number: 1096 - by El Forum - 07-18-2010, 12:16 PM
Database trouble - Error Number: 1096 - by El Forum - 07-18-2010, 12:24 PM
Database trouble - Error Number: 1096 - by El Forum - 07-19-2010, 10:38 PM



Theme © iAndrew 2016 - Forum software by © MyBB