Search for value within a comma separated values in MySQL

Multiple values are frequently kept in one column of a MySQL database as a comma-separated list. Finding a particular value within this list, though, can be difficult.

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

In PHPMyAdmin, you can import data in the database table in various formats e.g. SQL, CSV XML, etc. formats.

While import the CSV file in PHPMyAdmin needs to make sure that it should be a valid format like – the number of columns, data.

Similar functionality can be implemented with PHP where read the uploaded file and insert the record in the MySQL database table.

It is possible to check for duplicate entry with PHP while import but it is not possible in PHPMyAdmin.

Import CSV file data to the MySQL using PHP

Read more

Return JSON response from AJAX using jQuery and PHP

JSON stands for JavaScript Object Notation, it is a data-interchange format which is also been used to pass data from the server.

It is the best and most effective way when need to return multiple values as a response from the PHP script to the jQuery.

You couldn’t directly return an array from AJAX, it must have converted in the valid format.

In this case, you can either use XML or JSON format.

In the tutorial demonstration, I will return an array of users from AJAX, while return converts the array into JSON format using the json_encode() function in the PHP.

On the basis of response show data in tabular format.

Return JSON response from AJAX using jQuery and PHP

Read more

What is MongoDB? and Windows Installation

It is a quick tutorial on MongoDB and how you can install it on your Windows OS. We will also learn some basic commands in MongoDB for example, creating and dropping a Database, Creation of a collection and some more operations related to the collection. Contents What is MongoDB? Windows Installation Commands     1. … Read more