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 761 posted 13 years ago by TheJasonParker
Can add columns to a table checking before if there
0 985 posted 13 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 1010 posted 13 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 701 posted 13 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 1040 posted 13 years ago by TheJasonParker
0 760 posted 13 years ago by xnet74
the following code can be used to create a table with a dynamic name
0 801 posted 13 years ago by gtaking
Use this to repair a corrupt table in phpmyadmin
0 756 posted 14 years ago by howardpanton
This SQL query will find all the SlideDeck related entries in your WordPress database.
0 715 posted 14 years ago by Jamie
0 754 posted 14 years ago by sjacunningham
0 750 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 1029 posted 14 years ago by daipratt
How to reset a root password in mysql with OS root user
0 720 posted 14 years ago by isholgueras
How to reset a root password in mysql with OS root user
0 731 posted 14 years ago by isholgueras
Use this to select all fields between two different dates
0 774 posted 14 years ago by howardpanton
2 942 posted 14 years ago by cjmling
Execute this script to replace old links inside the content of Wordpress posts.
0 706 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 760 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 1079 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 817 posted 14 years ago by timkinnane
Group by user defined price bands.
1 2277 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 667 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 789 posted 14 years ago by matula
3 973 posted 14 years ago by matula
5 897 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 988 posted 14 years ago by jbranca