Hi,
Im novice to Joomla. Plz help me to solve the problem,when im editing any record the record itself newly added each time.
Plz suggest me what can i do?
Help me how to solve this problem Topic is solved
Moderators: tjay, seadap, Rogue4ngel, matthewhayashida
Forum rules
Re: Help me how to solve this problem
Hi,
On the risk of you having solved it by now, I can say I had the same problem.
It was solved by adding a hidden field to the form, containing the value of
the auto_increment id field in the table of the database.
Hope this helps.
On the risk of you having solved it by now, I can say I had the same problem.
It was solved by adding a hidden field to the form, containing the value of
the auto_increment id field in the table of the database.
Hope this helps.
Re: Help me how to solve this problem
I think your problem is you dont load the record each time you edit it.
This is my code to edit a record. If there is $id of that record, load that record, else, save new.
This is my code to edit a record. If there is $id of that record, load that record, else, save new.
Code: Select all
$row = new mosDBTable( $database );
$newitem = false;
if ($id > 0) {
$new_cat = false;
$row->load($id);
} else {
$new_cat = true;
}
Signature Rules: viewtopic.php?f=8&t=65