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 122 posted 9 years ago by TheJasonParker
Can add columns to a table checking before if there
0 162 posted 9 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 156 posted 9 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 91 posted 9 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 138 posted 9 years ago by TheJasonParker
0 125 posted 9 years ago by xnet74
the following code can be used to create a table with a dynamic name
0 134 posted 9 years ago by gtaking
Use this to repair a corrupt table in phpmyadmin
0 119 posted 9 years ago by howardpanton
This SQL query will find all the SlideDeck related entries in your WordPress database.
0 94 posted 9 years ago by Jamie
0 96 posted 9 years ago by sjacunningham
Convert a Drupal time stamp field into a readable format. The Drupal time stamp field is in the UNIX format.
1 155 posted 9 years ago by daipratt
How to reset a root password in mysql with OS root user
0 94 posted 9 years ago by isholgueras
How to reset a root password in mysql with OS root user
0 100 posted 9 years ago by isholgueras
Use this to select all fields between two different dates
0 96 posted 9 years ago by howardpanton
2 137 posted 9 years ago by cjmling
Execute this script to replace old links inside the content of Wordpress posts.
0 100 posted 9 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 100 posted 9 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 171 posted 9 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 95 posted 9 years ago by timkinnane
Group by user defined price bands.
1 494 posted 9 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 103 posted 9 years ago by jessibird
1 147 posted 9 years ago by Abe
for auto increment ids, when you delete records this will reset the number for the next auto id.
0 131 posted 9 years ago by matula
3 165 posted 10 years ago by matula
5 124 posted 10 years ago by matula