Reputation: 913
What I was wondering is the following: When you call a script, lets call it makePage.php, clicking on a button and thus making an AJAX-request. Do I have to establish a new database connection? Even if I already established a connection to load in the page where the button is rendered on?
Upvotes: 1
Views: 74
Reputation: 4481
the page you call with AJAX (more or less) acts like a page visited by a browser. there is no hidden magic going on, it's an independent page you load.
therefore you also have to care about database connections if you need them.
Upvotes: 3
Reputation: 164
Ajax always loads results only. So you need to establish a connection everytime to db for your ajax file.
Upvotes: 0