
Originally Posted by
ideasgirl
That's correct, my entry was products_id on that field, nothing else was touched.
Not correct. All the items started by 001- (I really don't understand why he did that, but I'm sure if there's any other way for him to create models it will be ok, since he's only using them to use EP, nothing else.
Okay, so below is a SQL statement that when used through the ZC Install SQL Patches area will update all blank model numbers to start with the string provided in the first part of the concat function (in this case 002-). Now, it hasn't been written to prefix zeros so that second part of the model number is a uniform length. That's a separate thing to address.
Code:
UPDATE products SET products_model=concat('002-', products_id) WHERE products_model='';
The end of that string is two apostrophes not a single quote.
If the above is run through mySQLAdmin, then the table prefix would need to be added to the 'products' statement.
For those reading this in the future. The prefix 002- was chosen because no other existing model # began with 002- and therefore no duplication would result.
Bookmarks