William
William

Reputation: 6610

Ajax Reading from a Database Dynamically

I'm developing a website/database solution which gives the administrator the option to sign into the webpage and perform actions on the database.

Currently they can add/delete/run pre-defined queries, however to 'edit' records in a table, I would like them to specify the primary key (ID) and then have ajax read in the values associated with that record and allow them to be changed.

What's the best way to go about this? Any pointers would be great!

Upvotes: 3

Views: 138

Answers (1)

Matt Healy
Matt Healy

Reputation: 18531

Firstly, you'll probably want to use a Javascript framework such as jQuery which takes care of a lot of the heavy lifting for you.

The main API methods you'll be concerned with are

  1. serialize to convert your form data into a string to be passed to your PHP script
  2. Ajax to perform the Ajax call (passing in details of the data you're changing)

Upvotes: 1

Related Questions