⇧
vadnica-logo
My Services About the Project Telegram O meni O meni

AJAX with a Database

AJAX is used for interactive communication with a database without reloading the page. In the example below, we will use the customers table, which you already know from our SQL simulator. You will learn how JavaScript sends the last name of the selected person to a PHP script, which then uses a MySQLi query to find their details (first name, email address, city) and returns them to the browser. When you select a customer from the dropdown list or click on their name, the showData() function is triggered via the onchange event, dynamically updating the content on the screen.

EXAMPLE
RESULT