Posts

How to insert Gujarati or other langauges data to mySQL?

-> First of all create any database then execute below queries: CREATE TABLE `multi_lang` (`data` varchar( 1000 ) CHARACTER SET utf8 COLLATE utf8_bin default NULL); INSERT INTO `multi_lang`VALUES ('ગુજરાતી'); Now see your table data.

Change Date Format

<?php $date = "18/11/2015"; $change_date = str_replace('/', '-', $date); echo $result_date = date('Y-m-d', strtotime($change_date)); ?> //output: 2015-11-18

Remove index.php from config.php file using htaccess in Codeigniter

Image
- Make  .htaccess file and copy below code. - Put .htaccess file to codeigniter or your project folder. - For Ex.:   <IfModule mod_rewrite.c>   RewriteEngine On   #RewriteBase /   RewriteCond %{REQUEST_FILENAME} !-f   RewriteRule ^ index.php [QSA,L] </IfModule>

Solved JS Modal Problem of Stay Top

Put this code to bootstrap.js file //After this code if (!that.$element.parent().length) {         that.$element.appendTo(document.body) // don't move modals dom position       } // put this code /* ****************************** */         var offset = $(document).scrollTop();         // Get the window viewport height         var viewportHeight = $(window).height();         // cache your dialog element         var $myDialog = that.$element; //$('#cbf_scategory');         // now set your dialog position         $myDialog.css('top',  offset);     /* ****************************** */

Convert number to word in php

<?php function convert_number_to_words($number) { $hyphen = '-'; $conjunction = ' and '; $separator = ', '; $negative = 'negative '; $decimal = ' point '; $dictionary = array( 0 => 'zero', 1 => 'one', 2 => 'two', 3 => 'three', 4 => 'four', 5 => 'five', 6 => 'six', 7 => 'seven', 8 => 'eight', 9 => 'nine', 10 => 'ten', 11 => 'eleven', 12 => 'twelve', 13 => 'thirteen', 14 => ...

Get Next Month Data in PHP

<?php //***************** Query ************ $query = "select * from test_table where date < date_sub(now(), interval 1 month)" ; $res_query = mysql_query($query); //*********** OUTPUT ************ int_id      name        date 1           Sandy     04-06-2015 2           Vandy    11-06-2015 3           Andy     18-06-2015 //******************************** ?>

Php Open Tag setting

Image
See the below image