And there are a few reasons NOT to do it this way.
1. Your SQL should never be in the controller
2. You are not leveraging the framework
3. You query is not escaped properly and is prone to SQL injection

… for more details check on IRC channel or even search here, why query() should be avoided for the vast majority of cases.

sk8terboi

Thanks a lot!!!!!!!!!
This above simple thingy helped me a lot when i needed it ^_^