I have the following joomla class for a component in joomla 1.0
and in the part of the program that writes to the database, I have the following code:
to write two names (fn1,ln1 and fn2,ln2) to the names table in the database.
My problem is that doing one store request after the other, it seems to me that the second one is overwriting the first one. Maybe there is a method in mosDBTable to get out from the previous row and free $name_tbl for the next store?
| Code: |
| class simpanniv_names_tbl extends mosDBTable {
var $name_id = null;//primary key var $first_name_str = null; var $last_name_str = null; var $sexo = null; function simpanniv_names_tbl(&$db){ $this->mosDBTable('#__simpanniv_names', 'name_id', $db); } } |
and in the part of the program that writes to the database, I have the following code:
| Code: |
| $name_tbl = new simpanniv_names_tbl($database);
$name_tbl->set('first_name_str',$fn1); $name_tbl->set('last_name_str',$ln1); $name_tbl->store(); $name_tbl->set('first_name_str',$fn2); $name_tbl->set('last_name_str',$ln2); $name_tbl->store(); |
to write two names (fn1,ln1 and fn2,ln2) to the names table in the database.
My problem is that doing one store request after the other, it seems to me that the second one is overwriting the first one. Maybe there is a method in mosDBTable to get out from the previous row and free $name_tbl for the next store?
