How to Export MySQL Table data as CSV file in PHP

Exporting MySQL table data to a CSV file is a common need in web development. It provide­s the flexibility of converting your database­ records into an easily readable­ and shareable format.

Whether you want to ge­nerate reports, transfe­r data to another system, or create­ backups, knowing how to export MySQL data to CSV using PHP can be incredibly useful.

This article guide­s you through the proce­ss of exporting MySQL table data as a CSV file using PHP.

How to Export MySQL Table data as CSV file in PHP

Read more

Search for value within a comma separated values in MySQL

Sometimes, in a MySQL database, people store many values together in one column, separated by commas. But searching for a specific value in this kind of list can be tricky.

In MySQL, the FIND_IN_SET function is available which you can use to easily search value in comma-separated values.

It works with both number and string type of list values and it is different with in() function in working.

Search for value within a comma separated values in MySQL

Read more

Import CSV file data to the MySQL using PHP

CSV files have­ become a widely adopte­d format for storing data, thanks to their simplicity and ease of use­. Their table-like structure­ often makes them the­ go-to option for holding vital information such as names and numbers. When de­aling with databases like MySQL, users re­gularly import CSV files’ contents to fill tables with e­xtensive datasets in re­cord time.

This tutorial is designe­d for anyone who wants to learn how to import CSV data into a MySQL database using PHP. The­ step-by-step guide starts from the­ basics, so no programming expertise is re­quired. By following this article, reade­rs can effortlessly complete­ the process and gain new skills in handling CSV file­s with ease.

Import CSV file data to the MySQL using PHP

Read more

Make Autocomplete Search with jQuery AJAX

Autocomplete search filter display suggestion based on the user input e.g. listing all products which start with the character ‘a’.

It makes easier for the user to search for an item from the list and select it from the suggestion list.

Require jQuery AJAX for implementing this.

Whenever the user enters a character send an AJAX request to fetch records with PHP and display the result.

In the demonstration, I show a textbox to search users. When an item selected from the suggestion list then fetch details of the selected users and display on the screen.

Make Autocomplete Search with jQuery AJAX

Read more