I have retrieved a data from the database table and displayed it in a table format in a php file. Now i've got to edit that retieved data when a link "EDIT" is clicked, using php.
for e.g.,
file1.php:
=========
NAME SUBJECT MARKS ACTION
Nandhu Maths 78 Edit
----
Benhur English 80 Edit
----
Is that possible?
Veselin
2008-04-23 09:05:16
Re:
yes you can edit the data. You need to create a web page (edit.php) with a form and input fields for each data element. Then next to each record in the table you have will put an edit link which passes record id e.g. edit.php?id=1, edit.php?id=2, ... When the edit.php page is opened you will select only the record with selected ID and fill in the values in the input fields. Then upon submitting the form you should run update query to change the record.
Nandhu
2008-04-23 09:19:49
Re: This isn't a form....
Yes Thank u....
But, this isn't a form im using in this file1.php
i'm just using a table for display...
jus have a look at the foll. coding....
Here when i click on the link 'EDIT' i should be able to edit the field 'Main Product' for every record.
So is dat possible?
Veselin
2008-04-23 09:25:38
Re:
using JavaScript (or Ajax) you can make it edit the record without refreshing the page. But easier is to click on edit link and open new page with form and all fields values filled in.
Nandhu
2008-04-23 09:30:34
Re:
Thanks for ur suggestion.
ok... I'll make a try n get back to u...
Nandhu
2008-04-23 11:49:03
Re: Got it
I opted for the easier method u suggested n I got it. Thanks a lot...