Due to the constant crawling and scrapping of the site by bots, any email addresses shown on the site are prone to spamming. Best way is to avoid showing any email address on site and use a contact us page that triggers a mail to a specified email address. But in case you need to […]
Category: Others
SQL query results to CSV
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 […]