StanleyDev
Member
- Nov 13, 2011
- 35
- 0
Im making a lotto system, and I have made most of the code but I just cant figure out how to send the SQL query into the DB to record the number that user choose/and to remove the appropriate number of lotto points(made a currency as well).
The query codes are:
I want it to send when the user clicks on a button
Could someone please write a code for a button so it could execute these query's when it is clicked.
The query codes are:
PHP:
<?php
$db = mysql_query ("INSERT INTO `lottery` (`id`, `username`, `num`) VALUES ('$uid','$id','$finalnum');");
$db2 = mysql_query ("UPDATE `users` SET `lotto_points`='0' WHERE (`id`='$uid');"); // Remove 24 lotto point from the user, poor thing.
?>
Could someone please write a code for a button so it could execute these query's when it is clicked.