php - Using jquery .ajax to retrieve records from mySQL DB -


I am a mysql noob, and a little stupid question ...

I use jquery I am sending a form to a php script which then stores the data in a data database on any other page of my app, I have been asked to call all the columns of a column, using mySQL db, then jquery I think I have to write another php script too) I can use the recovery data I am very familiar with GET for sending posts or sending data, but suddenly I realized that I do not know how this can be used by a JCL callback function.

By the way, I am using php4.

Any help would be appreciated!

You are looking for

Here is an example of using which JSON sends PHP. JSON sends data back.

By the way, are you using the same JavaScript framework? If not, I highly recommend it because it can be the essence of cross-browser interaction and error with phone. Here's one:

  $ Ajax ({url: 'document.xml', type: 'GET', datatype: 'xml', timeout: 1000, error: function () {alerts ('error loading XML document');}, success: function (Xml) {// something with xml}});  

Now everyone assumes that you are using PHP 5.2+ (which was when adding json_encode () / json_decode ()). If not, you may have to use XML instead.

Here's another one. If you are using jQuery, so parsing xml gets a little easier, see

The XML (and the messages are slightly more verbose) is more tedious to deal with, but it's definitely safe. This is worth pointing to perfection.


Comments