How could I do this?


Posted on 16th Feb 2014 07:03 pm by admin

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?

Code: <?php
session_start();
Did you know?Explore Trending and Topic pages for more stories like this.
$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');
?>
No comments posted yet

Your Answer:

Login to answer
200 Like 19 Dislike
Previous forums Next forums
Other forums

search query in mysql in php problem
my search query wont work, i know, that my codes are correct.please help

Code: [Select]&l

if php cookie set, show code...
Hi all.. I need to figure out this little snippet right quick.. seems like it should be easy enough

radio button reamains checked
Hello i'm trying to keep the state off my radio buttons so it shows which ones where clicked after t

Wordpress IE issue
So I am trying to add the background shadow to my wordpress page. It works fine in Firefox but does

PHP & MS Access - Line Break
Hey Guys!

I'm pulling records from an MS Access database and listing them using PHP and I'm r

Pagination
Okay here is the page in question: http://blenderteachings.000a.biz/tutorials.hamishhill.php

Where is my php.ini???
Hi

First off - apologies - i'm not a coder so this may sound very amateur.

I'm having

remove innitial

and

tags
i am using tiny_mce as a text editor for my CMS.
buy now the problem is it add <p>

POST into Array problem
Hi Chaps,

I have a repeat region, displaying rows of data: jobid, fromtable, translatorcharge

Performance impact of cookies
Hi, I was just wondering what impact there would be in terms of performance if you where to set then

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash