Welcome To Snipplr
Everyone's Recent MySQL Snippets
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
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
750
posted 13 years ago by TheJasonParker
MySQL
Create new table from a selection from another existing table (including copying data structure)
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
1000
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
690
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
1020
posted 13 years ago by TheJasonParker
the following code can be used to create a table with a dynamic name
0
791
posted 13 years ago by gtaking
This SQL query will find all the SlideDeck related entries in your WordPress database.
0
708
posted 13 years ago by Jamie
Convert a Drupal time stamp field into a readable format. The Drupal time stamp field is in the UNIX format.
1
1002
posted 14 years ago by daipratt
Execute this script to replace old links inside the content of Wordpress posts.
0
694
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
744
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
1065
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
803
posted 14 years ago by timkinnane
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
657
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
777
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
981
posted 14 years ago by jbranca