I am now splitting the product table by user ID, and when I view the Product detail page, the user id+ Product ID must be in the URL link to navigate to the table where the product is located, and then read the information.
I do not want to take two parameters in the URL, I want to merge the user id+ Product ID into one parameter (or other side test), so we need an algorithm to the user id+ Product ID processing, but do not know how to do
Reply content:
I am now splitting the product table by user ID, and when I view the Product detail page, the user id+ Product ID must be in the URL link to navigate to the table where the product is located, and then read the information.
I do not want to take two parameters in the URL, I want to merge the user id+ Product ID into one parameter (or other side test), so we need an algorithm to the user id+ Product ID processing, but do not know how to do
User ID 12, Product ID 1200, the final ID is 12b1200, B is the meaning of belong, it doesn't matter, separate on the line
What algorithm ah, really ... Do not look good, not tall on the use of what 16 18 20 50 in the process of what to do under the link, see the Code of people will feel good NB
Do the cache, find the corresponding data
Just make it into a JSON form. http://url/?id={' uid ': ' PID ': 1200}, so the background processing is also convenient.
Or you just have to be ruthless, all the parameters are encapsulated in JSON.
Http://url/?par={' a ': ' xx ', ' B ': ' XX ' ...}
Dizzy, back to edit the third time, really addictive
There is also a solution, is to make a table to specifically record a user released the several products, this way the details page just need to load the product ID, and then use the Product ID to link the table to find the user ID, and then splicing the library name to find the product details.
Of course there is a premise that the product ID is unique