Generate Zero-Fill Auto-Incremented Id In MySQL

Zero-Fill Auto-Incremented Id This tutorial shows how to generate zero-fill auto-incremented unique identifier in MySQL. Sometimes you may need to generate such keys which are used in some part of the application for business logic. Below example shows how to generate zero-fill auto-incremented id in MySQL table.

Select only one random item from each category in MySQL

This tutorial shows how to select items randomly from each category in MySQL. So here I will select exactly one item randomly from each category. People who need sometimes to select photo from each photo category and display them on the page for animation purpose will be benefited. In this example I have used two sample tables with data. You…

Custom regex function to replace characters in MySQL

This tutorial shows how to replace the characters in a string or text using regular expression in MySQL function. There is no built-in function available to replace any character in a string or text in MySQL so here I am creating a custom function.