By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,136 Members | 1,054 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,136 IT Pros & Developers. It's quick & easy.

how to update record using ajax and php

100+
P: 254
Hi

I am displaying record using php. I am giving the record structure in html format.

Admin will allow user to view the no. of record user will view.
Expand|Select|Wrap|Line Numbers
  1.  
  2. <table>
  3. <tr><td>name</td><td>age</td><td>show status</td>
  4. <tr><td>xyz</td><td>12</td><td>yes</td>
  5. <tr><td>abc</td><td>22</td><td>yes</td>
  6. <tr><td>mno</td><td>32</td><td>yes</td>
  7. <tr><td>pqr</td><td>19</td><td>yes</td>
  8. </table>
Say for first record when User will click yes it will update its corresponding record to the database to no i.e not visible to user and it will then be not visible to user at front end.

How this will done using Ajax and php.
Jan 31 '08 #1
Share this Question
Share on Google+
5 Replies


acoder
Expert Mod 15k+
P: 16,027
Say for first record when User will click yes it will update its corresponding record to the database to no i.e not visible to user and it will then be not visible to user at front end.
Is this for the admin or for the user (the clicking)?
Feb 1 '08 #2

100+
P: 254
Is this for the admin or for the user (the clicking)?
This is for admin. Admin will decide which item he wanted to show to user.
Feb 2 '08 #3

acoder
Expert Mod 15k+
P: 16,027
For the show status field, either use a button, checkbox or radio button. Use onclick to trigger the Ajax function. Depending on the selection (yes/no), set the field in the database using PHP.
Feb 2 '08 #4

100+
P: 254
For the show status field, either use a button, checkbox or radio button. Use onclick to trigger the Ajax function. Depending on the selection (yes/no), set the field in the database using PHP.
Actually in project I wanted to show the status using image(Icons) so when that image will be clicked its corresponding status image will display means if it is active is then active image will come and if deactive then deactive image will come.
Feb 5 '08 #5

acoder
Expert Mod 15k+
P: 16,027
Actually in project I wanted to show the status using image(Icons) so when that image will be clicked its corresponding status image will display means if it is active is then active image will come and if deactive then deactive image will come.
Then just change the src property of the image to "active.gif" or whatever.
Feb 5 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.