Home > front end >  How Ajax can read MySQL data?
How Ajax can read MySQL data?

Time:09-28

My idea is that a database query, take out your data shows, then display the data to delete, so cycle, can see the real-time data, but do not know the code is written, there are bosses know

CodePudding user response:

Can open a timer, regularly visit the background database, take to the data can be directly used,
 window. SetInterval (function () {
$. Ajax ({
Type: "GET",
Url: your url,
Success: the function (result) {
//will return to the database according to the results on the page
}
});
}, 1000);

I set the timer of cycle per second is to get the data,

CodePudding user response:

reference 1st floor baiy20151018b response:
can open a timer, regular access to background database, take to the data can be directly used,
 window. SetInterval (function () {
$. Ajax ({
Type: "GET",
Url: your url,
Success: the function (result) {
//will return to the database according to the results on the page
}
});
}, 1000);

I set the timer of cycle per second is to get data,

Url: this column is written?

CodePudding user response:

URL request address of the writing background, direct access and display data can be placed in the browser's address

CodePudding user response:

Ajax call back-end services, by the service calls to add and delete database for data, you didn't learn after the end of the technology?

CodePudding user response:

reference 4 floor aw277866304 response:
ajax call back-end services, by the service calls to add and delete database for data, you didn't learn after the end of the technology?

Do not, after a period of understanding,
  •  Tags:  
  • Ajax
  • Related