In this simple example I will show you a way to perform a custom sorting in MySQL. In this guide of custom sorting I am going to sort mysql rows based on the alphabetical order of the field values. Most…
Tag: PHP
Spliting CSV (comma seperated) entry grouped by double quotes
By using fgetcsv function we can have well formatted output for csv data without any pain. If you don’t want to use fgetcsv function for some reason and your CSV comma separated entries may contain comma inside except the delimiters,…
To find mysql recodrs between specific date range based on start date and end date fields
While working on a report generation system i had to perform a query to check whether records exist in ‘reports’ table between a date range received from two form fields “start_date” and “end_date”. To make it more specific i will…
Convert month name to month number in php
While working with a CJ run reports script i needed to convert “month name” into “month number” so i could store it in the database in date format. After doing some cleaning stuff i was ending with the month name,…