MySQL Ignore tables
Commands to export MySQL database schema, database with data, selective tables, ignoring tables
Commands to export MySQL database schema, database with data, selective tables, ignoring tables
Get MySQL table sizes using a query
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 […]
Here is a way to connect mssql database using Magento’s inbuilt models. Hope this is helpful
I am writing here an important code snippet for getting the database connection details used in Magento
Hello All, I am writing here an important code snippet for getting the table prefix (if any defined) in Magento.
I am writing here a small but useful snippet of code, for getting the table name of any module (whose table name are defined in config file). This is very useful when using joins in query. Suppose my module is ‘vendor’.
Hello All, When we are filtering data in Magento, time occurs when we want to fetch result after filters like Not equal, greater than, less than, etc. The addFieldToFilter method’s second parameter is used for this. It supports an alternate syntax where, instead of passing in a string, you pass in a single element Array. […]
Some of you might be knowing that there is a functionality in MySQL database for storing files and retrieving the same. This is mainly used when we need to reduce response time for retrieving and using files in our application. I am listing here the method for inserting image file in and retrieving image file […]
I am listing an example for retrieving the Joomla database prefix.