Map integer to text string in mysql

Posted by on Mar 18, 2014 in MySQL, Php | No comments yet

We can use the functions CASE .. WHEN … to map integer to text string in mysql The example query is as shown below You can also use the ELSE clause to specify a default, e.g.

Delete all categories in Magento

Posted by on Mar 18, 2014 in Magento | No comments yet

If you have been working on a demo store – or yours is still in the early stages of construction, you will probably find it necessary to remove all the categories to start fresh at some point So here is …

Find and Replace with MySQL

Posted by on Mar 7, 2014 in Snippets | No comments yet

— 1st example UPDATE files SET filepath = REPLACE(filepath,’path/to/search’,’path/to/replace’); — 2nd example UPDATE customers SET address = REPLACE(address,’_CODE_’,postcode);

Remove File Extention From URLs In .htaccess

Posted by on Mar 7, 2014 in Snippets | No comments yet

# Method 1: RewriteRule ^about$ about.php [L] # Method 2: RewriteCond /%{REQUEST_FILENAME}.php -f RewriteRule ^([a-zA-Z0-9_-\s]+)/$ /$1.php

Load More