I tried running that query - someone knows their sql, but not me! I had zero rows affected no matter how I tried to run it, and I did setup the temp table and import into that so I am happy with my syntax.
I ended up using a few simple queries, one to get the product_id from the sku, then updated everything after that, less elegantly than the one statement above. I would still like to see what you got though, what works for you.
Someone - hint, hint, needs to put a wiki article on this as everyone is left to find out for themselves or use the ‘dataflow’ route.
Very neat! Impressive, clean code - if only that had been up here earlier. I really would advise posting that in the ‘wiki’ for the next person. Thanks muchly.
Hi. Here is an updated full version of script. Now it can do:
- Update products in magento database
- Insert products if they not exist in magento DB
- Insert/update MANUFACTURER field
- Update QTY, PRICE, DESCRIPTION, SHORT_DESCRIPTION, and some my custom attributes.
Update part is direct-SQL. Insert part uses magento API it’s based on code written by blakew.
This means you don’t need to hardcode the db info in the script. Needless to say, the include for Mage.php below the initial config needs to go.
function updateTempTableFromFile($db_magento, $path){ $db_magento->query("CREATE TEMPORARY TABLE IF NOT EXISTS temp_table (sku CHAR(50), qty INT(32))");
This creates the temp_table for you, if it isn’t there already, as a temporary table. Again fairly obviously you’ll need to change the columns to the ones you actually want to use.
Yeah. You got your login wrong. Make sure your web services user/pass(apikey) is what it should be, give the role full permission for everything and all should be cushty.
Disovery is wright. sphays. You should contact Your web sevices provider. You are not only one who get this error. You just have not all the permissions. If You run LOAD DATA INFILE query in phpMyAdmin You will get the same error.
as I stated in the post...we have verified the database connection credentials and the database user permissions serveral times over and continue to get this error....