Welcome To Snipplr


Everyone's Recent MySQL Snippets



Wrap these two sets of commands around your sql backup if it hasn't come from a backup from the Magento admin interface (Magento adds this). This stops foreign key checks and then restarts them. The /*!40101 ---- */ code around the SET command...
0 965 posted 14 years ago by TheJasonParker
Can add columns to a table checking before if there
0 1246 posted 14 years ago by jatubio
This is ideal for testing queries etc. Run this to copy a selection of data into a new table with the same scructure. Then you can run test queries etc on it. Once you are happy then run the queries on the live data table...enjoy
0 1260 posted 14 years ago by sjacunningham
After the MySQL above has run – you’ll need to let Magento take the reigns back a little to update the category indexes, this is quite straightforward, but a little time consuming. Login to your admin and go to System > Cache Management, the s...
0 877 posted 14 years ago by TheJasonParker
You'll first need to find the attribute_id value for 'status' for your Magento installation and replace 273 in this example. The easiest way to tell is if you go into: Admin > Catalog > Attributes > Manage Attributes Then in the “Attribute...
0 1258 posted 14 years ago by TheJasonParker
0 961 posted 14 years ago by xnet74
the following code can be used to create a table with a dynamic name
0 1037 posted 14 years ago by gtaking
Use this to repair a corrupt table in phpmyadmin
0 955 posted 14 years ago by howardpanton
This SQL query will find all the SlideDeck related entries in your WordPress database.
0 896 posted 14 years ago by Jamie
0 937 posted 14 years ago by sjacunningham
0 957 posted 14 years ago by luglio7
Convert a Drupal time stamp field into a readable format. The Drupal time stamp field is in the UNIX format.
1 1283 posted 14 years ago by daipratt
How to reset a root password in mysql with OS root user
0 966 posted 14 years ago by isholgueras
How to reset a root password in mysql with OS root user
0 949 posted 14 years ago by isholgueras
Use this to select all fields between two different dates
0 972 posted 14 years ago by howardpanton
2 1167 posted 14 years ago by cjmling
Execute this script to replace old links inside the content of Wordpress posts.
0 892 posted 14 years ago by jhonqwerty
SQL query to update *wp_options* records that are specific to the host of a WordPress site. Run this query after copying the DB to another server (if this URL is different). Useful for deploying WordPress from a dev server to a live environment.
1 982 posted 14 years ago by errkk
When working on client sites, you often need admin access, instead of requiring them to set up an admin user, just make your own. ref: http://www.dnawebagency.com/how-to-add-an-admin-user-to-the-wordpress-database
2 1345 posted 14 years ago by timkinnane
If you\'ve got a Wordpress install that\'s changed domain or you\'re making a local or development copy, you\'ll need to update the Wordpress DB tables with the new URL.\r\nThe first step is the options table, with siteurl and homeurl. The posts als...
1 1044 posted 14 years ago by timkinnane
Group by user defined price bands.
1 2544 posted 14 years ago by daipratt
Change \"wp\" to your database prefix. Note, this is the quick and dirty way. The more thorough way, which will also clean any tags or categories that are now unused, is here: http://www.snipplr.com/view/29570/get-rid-of-unused-post-revisions/
2 858 posted 14 years ago by jessibird
for auto increment ids, when you delete records this will reset the number for the next auto id.
0 1015 posted 14 years ago by matula
3 1178 posted 14 years ago by matula
5 1144 posted 14 years ago by matula
You have two tables galleries and images, and you need to know how many images each gallery has associated with it. This Query returns the sum of distinct record joined to another table by a common field (gallery_id).
0 1293 posted 14 years ago by jbranca