Category : MySql


Mysql procedure with pagination in laravel 5?

You are working on laravel with mysql database. you had created mysql procedure for get data and you want to call procedure with pagination in laravel 5 then you can not directly make pagination as laravel document.If you are using directly MySQL stored Procedure in your controller, model or repository and you want to give pagination like this way : <pre class="language-php"> $data = DB::select(DB::raw('CALL hardik("hari")'))->paginate(5); </pre> This way you found error in your Laravel 5 website. we can't give directly this way pagination because your procedure will get all the data fr.....

By Hardik Savani | January 11, 2016 | | 3177 Viewer | Category : MySql
READ MORE

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 | | 1218 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 | | 1688 Viewer | Category : MySql
READ MORE

    Laravel 5 - line chart example code using google charts API

    Laravel 5 - line chart example code using google charts API

    Open Post

    PHP - import excel file into mysql database tutorial

    PHP - import excel file into mysql database tutorial

    Open Post

    Laravel 5 - Image Gallery CRUD example from scratch

    Laravel 5 - Image Gallery CRUD example from scratch

    Open Post

    How to install laravel in your Android Phone

    How to install laravel in your Android Phone

    Open Post

    Simple Highcharts Chart Example using PHP MySQL Database

    Simple Highcharts Chart Example using PHP MySQL Database

    Open Post

    AngularJS - simple image upload with preview example in PHP

    AngularJS - simple image upload with preview example in PHP

    Open Post