Upload or change product info directly to a MySQL db

Please check here first before posting a question. We will update this forum on a regular basis with tips and how-tos.

Moderator: frankjan

Post Reply
Site Admin
Posts: 392
Joined: May 03, 2004 8:57 pm

Upload or change product info directly to a MySQL db

Post by frankjan » Jun 16, 2010 11:55 am

While using SurfShop's import feature is an easy way of uploading new items or changing existing information, sometimes it's faster to go directly to your MySQL db. It's easy with the following code:

Code: Select all

REPLACE  INTO  `catalog` (`itemid`,`description`,`unitprice`,`memberprice`,`wholesaleprice`,`specialprice`,`priceList`,`weight`,`other`,`categories`,`long_desc`,`option1`,`option2`,`option3`,`image`,`large_image`,`taxable`,`customfield`,`volume`,`hazardous`,`shipping`,`inventory`,`relateditems`,`HotItem`,`HotItemMessage`,`startingd`,`endingd`,`hide`) VALUES  ('item_ID','Short Description','7.99','7.99','7.59',NULL,'10.55','1',NULL,NULL,'Long description goes here.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'7.99',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL) ;
REPLACE INTO is a "one size fits all" MySQL command that will either replace an existing record or, if it doesn't exist already, will create a new record. Just remember to use NULL if the field is blank, as in the above example.

If you use an in-house database like FileMaker Pro, this code code can be scripted to run directly from your db making it a simple, one-click way to upload new information on the fly.
Frank Jance
SurfShop Forum Admin

Setting Up Shop Has Never Been Easier!

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest