Welcome Guest, Not a member yet? Register   Sign In
Lowercase DB table name problem.
#1

[eluser]rbnc[/eluser]
Hi everyone,

I'm just moving a CI project onto a staging sever which I've not used before and I've encountered a issue regarding the capitalisation of my table name.

Quote:A Database Error Occurred
Error Number: 1146

Table 'qualityv.Property' doesn't exist

SELECT * FROM (`Property`) WHERE `id` = '2265' LIMIT 1
Code:
function get_from_id($property_id)
        {
            $query = $this->db->get_where('property', array('id' => $property_id));
            
            if($property=$query->row())
            {
                
                return new property($property->id);
            }
            return false;
        }

You can may have noticed I'm selecting from 'property' using the activerecord as the table is called 'property' not 'Property' yet I can see activerecord is attempting to select from Property.

The project works on my Mac, and a fasthosts Ubuntu linux server. But is doing this on this Fedora server.

Another thing noting is that when first running the project on this new I had to rename all of the model files to be lower case as it wasn't finding them. There seems to be something going on with the casiness of this server (newly coined word).

Thanks all Smile
#2

[eluser]WanWizard[/eluser]
Are you sure you're looking at the right piece of code?

There is no code in the AR library that would modify a table name. Also, your query has 'LIMIT 1', which your code example doesn't define a limit...




Theme © iAndrew 2016 - Forum software by © MyBB