Entrepreneur, Web Developer and Facilitator from God's Own Country

MySQL database size using query

I think this works fine

 

SELECT table_schema "Data Base Name",
sum( data_length + index_length ) / 1024 /
1024 "Data Base Size in MB",
sum( data_free )/ 1024 / 1024 "Free Space in MB"
FROM information_schema.TABLES
GROUP BY table_schema ;

 

Found at MySQL Forums

Last date of a month in php

Last date of a month in php

May 12, 2011

I have came across some crazy snippets of code finding the last day of a month in php. Then I came across this very simple method. PHP date function takes a paramater as ‘t’ which gives the number of days of a month which is the last day Winking smile

so

<?php
echo date(‘Y-m-t’)';
?>

will give you the last day of the month

You can use the same method to find the last method of any month/year using strtotime

<?php
echo date(‘Y-m-t’, strtotime(‘next month’));
?>

Peace of cake right Smile

8pen–Reinventing the keyboard for touch enabled devices

Facebook Pages new interface

Facebook Pages new interface

Feb 24, 2011

This post will show the steps to activate new interface in Facebook pages

When you open your facebook page (the one with admin access) the upgrade suggestion will come. If you have a preview or directly upgrade the same. Upgrade

The preview will be like this.

12345

So once you click on upgrade, the confirmation will come.

Upgrade My Page

Java/JDK version on Linux

In Terminal, run

java –version

The numbers specifies the version

WordPress Mulitiste homepage redirect to register page issue

WordPress Mulitiste homepage redirect to register page issue

Feb 11, 2011

Wordpress Mulitiste Register page redirect issue

I have came across this issue a couple of times before. Although I couldn’t figure out how to solve it, I used to code redirects in the code to get rid of this. This happens when we install our self hosted wordpress with www. in your domain name. So tackle the issue, you just have to add the following line to your wp-config.php

define( ‘NOBLOGREDIRECT’, ‘http://www.goatweetups.in’);


 

Apparently this can be fixed using WordPress MU Domain Mapping plugin, but as I use wp-config.php to configure multisite, So I prefer to use the config fix instead of installing a plugin Winking smile