PIDZB
PIDZB

Reputation: 913

AJAX - database connection

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

Answers (2)

low_rents
low_rents

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

user3045457
user3045457

Reputation: 164

Ajax always loads results only. So you need to establish a connection everytime to db for your ajax file.

Upvotes: 0

Related Questions