Posts

Showing posts from September, 2017

Custom favicon sizes for CakePHP

Generate your icon here for different sizes :https://www.favicon-generator.org/ Put your images/icons inside webroot/ico directory. If you use theme/plugin, put it inside the webroot/ico of the theme Open your default.ctp and put this code inside <head></head>: 1 2 3 4 5 6 7 8 9 10 11 12 <head> <?php echo $this -> Html -> meta ( 'android-icon-36x36.png' , '/ico/android-icon-36x36.png' , [ 'type' => 'icon' ]); echo $this -> Html -> meta ( 'apple-icon-57x57.png' , '/ico/apple-icon-57x57.png' , [ 'type' => 'icon' , 'sizes' => '57x57' ]); echo $this -> Html -> meta ( 'apple-icon-72x72.png' , '/ico/android-icon-72x72.png' , [ 'type' => 'icon' , 'sizes' => '72x72' ]); echo $this -> Html -> meta ( 'apple-icon-76x76.png' , '/ico/appl

GET THE DATABASE SIZE FROM THE MYSQL QUERY BROWSER

Run the below query you can get the Data Base Size in MySQL.  If you run the query which is given below in MySQL Query Browser then you will get the two columns first will display the Data Base Name and the second will display the Data Base Size in MB.  This will display list of all database : 1 2 SELECT table_schema "Data Base Name" , sum ( data_length + index_length ) / 1024 / 1024 "Data Base Size in MB" FROM information_schema.TABLES GROUP BY table_schema ; This will display specific database db_name: 1 2 SELECT table_schema "Data Base Name" , sum ( data_length + index_length ) / 1024 / 1024 "Data Base Size in MB" FROM information_schema.TABLES WHERE table_schema = "db_name"

Ajax Request to PHP

Client Side 1 2 3 4 5 6 7 8 9 10 11 12 13 $ . ajax ({ url : '/path/to/server' , type : 'POST' , data : { first_name : firstName , last_name : lastName , address : address , city : city , country : country }, success : function ( result ) { var obj = jQuery . parseJSON ( result ); if ( obj . result == 'OK' ) { alert ( obj . message ); } else { alert ( obj . message ); } } }); Server Side response from php file 1 echo json_encode ([ 'result' => 'OK' , 'message' => 'This is message' ]);