Category : MySql


Which MySQL datatype use for store an IP address?

If you want to store IP address in mysql database then don’t mistake to use varchar datatype because you can use INT UNSIGNED 4(BYTE) datatype. using integer datatype you can save more space in database. when you fire insert query at that time use INET_ATON() and select query at that time INET_NTOA() use. how to use this function given bellow example. <strong>Create Table : </strong> <pre class="language-mysql"> CREATE TABLE IF NOT EXISTS `ip_addresses` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `ip_address` INT(4) UNSIGNED NOT NULL, PRIMARY KEY (`id`) ); </pre> <strong>Insert Da.....

By Hardik Savani | January 7, 2016 | | 2338 Viewer | Category : MySql
READ MORE

Mysql Hexadecimal color code store in binary datatype.

If you have thousands of record store, that time database size would be large. but you can some field can save your number of bites in the database. you have color field then most of you choose string(6) data type and you wast 6 bites on every record, but you can save number of bites data by using BINARY(3) data type. following example through you can set data type for hexa color code with only allocate binary(3) on every records. first how to create table and assign data type with following query. <pre class="language-mysql"> CREATE TABLE IF NOT EXISTS `colors` ( `id` int(10) unsigned NOT N.....

By Hardik Savani | January 7, 2016 | | 3580 Viewer | Category : MySql
READ MORE

    How to get keys name from array using array helper in PHP Laravel ?

    How to get keys name from array using array helper in PHP Laravel ?

    Open Post

    How to upload image with validation in PHP Codeigniter?

    How to upload image with validation in PHP Codeigniter?

    Open Post

    PHP MySQL - Simple Image Gallery CRUD example from scratch

    PHP MySQL - Simple Image Gallery CRUD example from scratch

    Open Post

    How to create custom facade in laravel 5.2?

    How to create custom facade in laravel 5.2?

    Open Post

    How to make simple dependent dropdown using jquery ajax in Laravel 5?

    How to make simple dependent dropdown using jquery ajax in Laravel 5?

    Open Post

    Laravel 5 Redirect to URL using redirect() helper

    Laravel 5 Redirect to URL using redirect() helper

    Open Post