XML AJAXLesson 28Free preview
AJAX Database
This lesson is part of XML · All levels
Summary
AJAX accesses the database indirectly: the browser requests the server script, the server script runs the query, and the result is sent back as XML or JSON. This pattern keeps database credentials on the server and opens security gates like SQL injections if not careful. With the query parameterization, data access from AJAX remains secure.
Key points
- The browser does not directly access the database
- The server script becomes the intermediary that runs the query
- The query result is returned as XML or JSON
- Prepared statement prevents SQL injection attacks
- Negative responses should be handled with a clear message
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.