CodeIgniter Forums

Full Version: How can I make a ONE model for edit delete update?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]ogib[/eluser]
This is mysql databases on my project.

category|c_id
product|p_id|c_id
properties|pr_id|p_id

To clarify: the category table contained in the categories of products in the product table contains only those products in a table containing all the properties for The Nature products. The Nature of the products are very different for each product!
How can I make a ONE model for edit delete update?
Sorry for my terrible English!

El Forum

[eluser]InsiteFX[/eluser]
Code:
public function edit($table_name, $src_id, $id, $data)
{
    $this->db->where($src_id, $id);
    $this->db->update($table_name, $data);
}

Something like that.

El Forum

[eluser]WanWizard[/eluser]
Or have a look at Jamie's base model

El Forum

[eluser]ogib[/eluser]
Thank you for your help, but it comes to the table properties in which each row contains a characteristic driven from table product.
For example: a product "shoes" has 10 description, this means 10 lines in the table properties, and another product "hat" has two characteristics that means 2 rows in table properties.
So how how can I make a ONE model for edit delete update
Thank you

El Forum

[eluser]Alexandre E. Souza (Joker)[/eluser]
I have a class for everythings
do you to want?

El Forum

[eluser]ogib[/eluser]
Yeah right!

El Forum

[eluser]Alexandre E. Souza (Joker)[/eluser]
what your e-mail for me send you?

El Forum

[eluser]ogib[/eluser]
Alexandre E. Souza my email is: [email protected]

El Forum

[eluser]Alexandre E. Souza (Joker)[/eluser]
I sent for you!!