|
Tags
|
|
Written by Jacek Zielinski
|
|
I like JTable function store() very much. It saves a lot of time while coding and prevents from making mistakes! I just want to share with you my thoughts about store(). So, from wiki we know that it
"Inserts a new row if id is zero or updates an existing row in the database table."
But how does it know, if it is a new row, or we just want to update one? Actually it is very simple - Joomla! binds all fields in POST form to database fields. If there is any field whichs name is exactly like primary key field in DB (with auto_increment option) then it knows, that there is existing record in database :-)
|
0 Comments