davespring Posted December 25, 2009 Share Posted December 25, 2009 Ive got a simple lottery game, and am using an sql database to keep track of the numbers bought. But, when the person comes to buy the ticket, I have to replay to my process page which ticket they want. How could I do this? <?php session_start(); $page = array(); $page['title'] = 'OpenTheBox | DuffLotto'; $number = 1; include('header.php'); require_once('/home/davespri/hidden/dbcon.php'); echo '<h1>OpenTheBox - The Original Community Game</h1>'; echo '<center> Available Numbers </center>'; $connect = mysql_connect($host, $user, $pass); if (!$connect) { die('Unable to connect to Mysql'); } mysql_select_db('davespri_Gamerecords', $connect); $result = mysql_query("SELECT * FROM OpenTheBox2"); echo "<center><table border='1'><tr><th>Slot:</th><th>Taken by:</th></tr>"; while ($row = mysql_fetch_array($result)) { echo "<tr>"; if ($row['Nickname'] = 'NULL') { $row['Nickname'] = "<center><form action=http://dufflotto.hostcell.net method=post> <input type=submit value=Buy! name=" . $row['Slot'] . "> </form>"; } echo "<td>" . $row['Slot'] . "</td>"; echo "<td>" . $row['Nickname'] . "</td>"; echo "</tr>"; } echo "</center></table></center>"; include('footer.php'); ?> Link to comment https://forums.phpfreaks.com/topic/186328-how-could-i-do-this/ Share on other sites More sharing options...
teamatomic Posted December 25, 2009 Share Posted December 25, 2009 I would store it in a session until the sale is complete. Link to comment https://forums.phpfreaks.com/topic/186328-how-could-i-do-this/#findComment-984008 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.