OldWest Posted October 21, 2010 Share Posted October 21, 2010 Although I am deciding on the best route to go on this, I was hoping for any feedback or ideas on the best and simplest approach to the below problem: Here is my table structure: old_code_1 old_code_2 new_code_1 new_code_2 prod_code_1 prod_code_2 Each of the following fields has 5 digits e.g. 00045, 12654, etc. What I need to achieve is this: Concatenate each set (of the 3 sets above) data into one variable e.g. old_code_1 + old_code_2 = 0004512654. So old_code_1 & old_code_2 would become a combined data and the same for the othe 2 sets. Then. Once concatenated, I need to compare: prod_code_1+prod_code_2 with old_code_1+old_code_2 and replace prod_code_1+prod_code_2 with new_code_1+new_code_2 where matches are found. The new_code_1 & 2 are in the same row as the old_code 1 & 2. So the data is in alignment that way for comparison. Thanks for any insight or suggestions on how to make this happen in the simplest form possible. Link to comment https://forums.phpfreaks.com/topic/216474-1-table-6-fields-concatenate-into-3-sets-compare-and-replace-where-match/ Share on other sites More sharing options...
OldWest Posted October 21, 2010 Author Share Posted October 21, 2010 I should note I do not need the Concatenate to output any new data. I just need it Concatenated in an array or the likes for processing, so the prod_codes can be updated in their respective fields. Link to comment https://forums.phpfreaks.com/topic/216474-1-table-6-fields-concatenate-into-3-sets-compare-and-replace-where-match/#findComment-1124827 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.