var ww = document.body.clientWidth; if (ww < 768) { } else if (ww >= 768) { }
Read MoreCodeIgniter
Calculate Date Difference in php
#Date Difference $date_1 = ‘2018-02-16’; $date_1 = ‘2018-02-18’; $dateDifference = dateDifference($date_1, $date_2); print_r($dateDifference); function dateDifference($date_1 , $date_2 , $differenceFormat = ‘%a’ ) { $datetime1 = …
Read MoreSelect all Checkbox in Javascript
Select all Checkbox in Javascript:: <script type=”text/javascript”> $(document).ready(function(){ $(“#checkbx_selectall”).on(‘change’, function() { if(this.checked){ $(‘.__chckbx_select’).each(function(){ …
Read MoreCheck if Field is empty or Not in Javascript
Check if Field is empty or Not in Javascript:: $(“#search-form”).on(‘submit’,function(){ var dis = $(this); searchbox = dis.find(“input[name=’product_name’]”).val(); var submitform = true; $(“#search-form-msg”).css(‘color’,’red’); if(searchbox.trim().length == 0){ …
Read Morefind input by name jquery in a form on submit in Javascript
find input by name jquery in a form on submit in Javascript:: $(“#search-form”).on(‘submit’,function(){ var dis = $(this); searchbox = dis.find(“input[name=’product_name’]”).val(); console.log(searchbox); return false; });
Read MoreAltering column size in SQL Server
Altering column size in SQL Server ALTER TABLE table_name ALTER COLUMN column_name datatype; LIKE:: ALTER TABLE `product` MODIFY COLUMN `updatedon` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP …
Read Moremysql – Split value from one field to two
How to split a single column values to multiple column values? For Example: #Current table Field is like:: Name ———— abcd efgh ijk lmn opq …
Read MoreConvert stdClass object to array in PHP
Convert stdClass object to array in PHP The easiest way is to JSON-encode your object and then decode it back to an array: $array = …
Read Morecodeigniter $this->db->like is case sensitive
There is no case insensitive version of the like function. What you can do is transform both sides of the comparison to lower case, so …
Read MoreCheck if uploaded file is CSV Format or not in php
$csv_mimetypes = array( ‘text/csv’, ‘text/plain’, ‘application/csv’, ‘text/comma-separated-values’, ‘application/excel’, ‘application/vnd.ms-excel’, ‘application/vnd.msexcel’, …
Read More