Hello I have a rating system I want to check that the user who posts an opinion on a product on my site buys it well and I want to ensure that he can give an opinion on each item he has purchased only
here are the sql tables in image it is composed:[ users ][ details] [ sales] [product] [products]
the [details] table is the products that the user has ordered with the id of the order as well as all the ids of the products that order it the sales table is the user's orders in my case the only user who ordered is id number 9 and he performed 2 commands the user id and stored in the session under the name of $user $user['id'] I think the problem comes from the product id because the product id and transform into product name so like this $slug = slugify($name); $name = $_POST['name']; its fact that rather than having an id in the search bar there is the name of the product but always has the id of the product in the table of course well for the opinion system it's the same thing it"s $pid which retrieves the product id via the get and store in the $pid and pid returns the product name or computer for example instead of id=8 product=hp-pavilion-power-580-015na-gaming-pc
here I hope you understood me to help me thank you and the product table is id and users is id also there is nothing else to recup.
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.
PHP (from the English Hypertext Preprocessor - hypertext preprocessor) is a scripting programming language for developing web applications. Supported by most hosting providers, it is one of the most popular tools for creating dynamic websites.
The PHP scripting language has gained wide popularity due to its processing speed, simplicity, cross-platform, functionality and distribution of source codes under its own license.
https://www.php.net/
Welcome to the Q&A site for web developers. Here you can ask a question about the problem you are facing and get answers from other experts. We have created a user-friendly interface so that you can quickly and free of charge ask a question about a web programming problem. We also invite other experts to join our community and help other members who ask questions. In addition, you can use our search for questions with a solution.
Ask about the real problem you are facing. Describe in detail what you are doing and what you want to achieve.
Our goal is to create a strong community in which everyone will support each other. If you find a question and know the answer to it, help others with your knowledge.