MySQL

Generate unique random ID in PHP MySQL

Generate unique random ID in PHP MySQL

In this short guide, I am going to show you how to generate a unique random ID in PHP MySQL. What is a unique ID? There will be a time when you or your client would need to have a random and especially unique ID (identification) in a web application. For example, for an ecommerce site, there will be order IDs assigned to each order.

Connecting to MySQL Database in PHP

Connecting to MySQL Database in PHP

Connecting to MySQL database in PHP is a very initial step for developing any web applications or website. I am going to mention the most common and efficient way for connecting to MySQL database in PHP. Amazingly, PHP provides three ways (API) to connect and interact with database (MySQL). MYSQL, MySQLi, and PDO (PHP Data Objects).

MySQL vs MySQLi in PHP

MySQL vs MySQLi in PHP

If you are looking for a simple answer for MySQL vs MySQLi in PHP, then here is the explanation in simple words. MySQL is outdated and deprecated in the newer versions of PHP. MySQL is completely removed in PHP 7. I strongly recommend to use MySQLi from now on. MySQLi stands for MySQL improved extension. Let’s see the differences…