I have a database with “Products” in it. And on the front end of the website I have a link next to each product that says “move to trash”.
When someone click on this link <a href="#">more to trash</a> I want to move that particular product with id=2 to “trash” table. How to perform a query so it moves that particular product to “trash” table width product Id and Name?
You could use ajax to run a php script which would execute the database query.
Here’s how to trigger a php script using javascript and ajax: How do I run PHP code when a user clicks on a link?