Welcome Guest, Not a member yet? Register   Sign In
Question about models

Whats the table format? I could not find it in the user guide... say for instance if I had a table named online_games what would the model name be? Thanks...

[eluser]Thorpe Obazee[/eluser]
The model names aren't associated with the table's names. You can name it anything as long as it follows the guidelines.


So how does it know the table name?

[eluser]Thorpe Obazee[/eluser]
They don't.
$query = $this->db->get($table_name);
return ($query->num_rows() > 0) ? $query->result() : FALSE;

although there are options like storing the table name in a property.

Although you can call your models anything you want, I call mine the singular of the table (in most cases)
So if I have a users table, the primary model for that table would be user (well, user_model.php, I add the suffix to avoid collisions)

Theme © iAndrew 2016 - Forum software by © MyBB