I am currently doing a school course project.It requires us to code out a website.We designed a website which provides online food ordering service to our school community.
I want to know how to change a data in a specific filed in mysql server by just clicking one button.
I designed a user profile page which shows the information of the users. They can see their previous orders by clicking "show orders" button. Then a table which contains the ordering information will be displayed.
I added a button behind each row called "Delivered". I wish that the Ordering_status can be changed from "ordering" to "delivered" when user click the "Delivered" button. I attached my layout page below.
https://www.dropbox.com/s/lyfjn9hed1zfjyd/user_profile.png
Could anyone kindly help me with this?
I cannot attach my code here. It will display in a mess manner. Please use the link below https://www.dropbox.com/s/u1h73lx07hrsr78/profile.php
Thank you!
<script>
function myfunction(int id)
{
$link=mysqli_connect("localhost","f34s25","f34s25","f34s25");
$a="UPDATE orders SET Ordering_status="delivered" where order_id=id;
$b=mysqli_query($a);
}
</script>
?symbol, you can click that to know the format and styling