Page 1 of 1
Help me how to solve this problem
Posted: Tue Oct 09, 2007 5:29 am
by jitendra_k
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?
Re: Help me how to solve this problem
Posted: Wed Nov 07, 2007 8:44 am
by houby
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.
myservice->srvc_autonr;?>" />
Hope this helps.
Re: Help me how to solve this problem
Posted: Wed Nov 07, 2007 1:57 pm
by ndtoan13
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.
Code: Select all
$row = new mosDBTable( $database );
$newitem = false;
if ($id > 0) {
$new_cat = false;
$row->load($id);
} else {
$new_cat = true;
}