Multiple times we get requests in projects to generate reports from database. Below command will be helpful in exporting the MySQL query results directly into CSV (comma separated values) file mysql -h {hostname} -u {username} -p {database_name} -B -e “SELECT code AS ‘Coupon Codes’ FROM salesrule_coupon WHERE rule_id=112” | sed “s/\t/,/g” > /tmp/coupon_code_$(date +%F).csv Above […]
Tag: Files
File Upload in PHP
Hello All, I had to make a custom form for file uploading in PHP, I am explaining here the way to upload a file.
DW File Management Component
Download the component :. Commercial version (with customizable features) : Visit . DW File Management Component and Plugin for uploading to, downloading and deleting files from Website based on Joomla 3 Framework. With the help of this plugin, by mentioning the file name or alias in the article, it will be replaced with its appropriate […]
File Upload in Magento
As you already might have noticed, there are many modules in Magento which has file uploading facility in admin end. I had to make a custom form for file uploading in Magento in frontend, I am explaining here the way to upload a file. Magento has a class (Varien_File_Uploader) defined for this purpose. The class […]
Encode Decode image using PHP
Hello, I am describing here the way to 1) Encode image to generate a string 2) Decode image from a given encoded string 1) Here you need to specifiy the path of your image in variable ‘$image_path’ 2) Here I am using the string produced from the executing the code seen above, it can be […]
Copy Directory
I am listing here the method to copy full Directories with all sub-directories and files.