Skip to content

MySql

Access MySQL from PHP

How to Access MySQL from PHP ?

  • by

In this tutorial, we are going to access MySQL database from PHP. Accessing MySQL from PHP is very simple and easy to implement. PHP contains built-in functions to connect the MySQL database and to access the data. Those functions are,

  • mysqli_connect – To connect the database by using the specified configuration.
  • mysqli_query – To execute a query to get resource id.
  • mysqli_fetch_row – To read row data with the reference of the resource id. There are many MySQL fetch functions in PHP to read table rows.

I have added an example code for accessing MySQL database from PHP. I used the database table named animals on which the create, read, update and delete (CRUD) functionalities are going to be performed.

Access MySQL from PHP
Read More »How to Access MySQL from PHP ?

jQuery-AJAX-Autocomplete

jQuery AJAX Autocomplete – Country Example

  • by

Autocomplete feature is used to provide the auto suggestion for users while entering input. In this tutorial, we are going to suggest country names for the users based on the keyword they entered into the input field by using jQuery AJAX.

jQuery Autocomplete function is called on the key-up event of the input field. This function requests PHP for the list of countries via AJAX by sending the value of the input field. In PHP, it reads country names from the database that starts with the keyword entered by the user.

Read More »jQuery AJAX Autocomplete – Country Example