Sample DB Importer Queries
From Documentation | Viadat Creations
Revision as of 21:07, 2 November 2009 by Admin (talk | contribs) (Protected "Sample DB Importer Queries": Excessive vandalism ([edit=autoconfirmed] (indefinite)))
For example, if your database table is named "store_locations":
SELECT * FROM store_locations
(It will pull all information from your 'store_locations' table into the Store Locator admin interface in order to be matched to the "wp_store_locator")
If you would like to import 200 locations at a time, so you don't overwhelm your database:
SELECT * FROM store_locations LIMIT 200
If for instance your "phone" field has numbers in the format ##########, but you want it to look like (###) ###-####:
UPDATE wp_store_locator SET sl_phone = CONCAT( "(", SUBSTRING( sl_phone, 1, 3 ) , ") ", SUBSTRING( sl_phone, 4, 3 ) , "-", SUBSTRING( sl_phone, 7, 4 ) )
(Note: If your WordPress prefix isn't "wp_", then update "wp_store_locator" in the below query to "{your WordPress prefix}store_locator")