right, im trying to build a sportsbook site and i have got stuck while trying to create a betslip using sessions. The problem is i need to be able to register a session every time a bet is made but i dont know how to do it without over writing the last one (ie using a different name)
i will put the code that i have so far
<?
session_start();
include ('dbconnect.php');
$addmatch = $_GET['addmatch'];
if(!isset($addmatch))
{
$sql = mysql_query("SELECT * FROM matches WHERE winner='tba' AND allowed='1'");
print "<div align='center'><font face='tahoma' size='2'>";
while($ab = mysql_fetch_array($sql))
{
if($ab['sport'] != 'tennis')
{
print "(".$ab['sport'].") ";
print "<a href='matches.php?addmatch=".$ab['id']."&team=".$ab['team1']."&odds=".$ab['odds1']."'>".$ab['team1']." at ".$ab['odds1']."</a>";
print " - ";
print "<a href='matches.php?addmatch=".$ab['id']."&team=draw&odds=".$ab['oddsdraw']."'>draw at ".$ab['oddsdraw']."</a>";
print " - ";
print "<a href='matches.php?addmatch=".$ab['id']."&team=".$ab['team2']."&odds=".$ab['odds2']."'>".$ab['team2']." at ".$ab['odds2']."</a> on ".$ab['date']."<br><br>";
}
else
{
print "(".$ab['sport'].") ";
print "<a href='matches.php?addmatch=".$ab['id']."&team=".$ab['team1']."&odds=".$ab['odds1']."'>".$ab['team1']." at ".$ab['odds1']."</a>";
print " - ";
print "<a href='matches.php?addmatch=".$ab['id']."&team=".$ab['team2']."&odds=".$ab['odds2']."'>".$ab['team2']." at ".$ab['odds2']."</a> on ".$ab['date'];
}
}
print "</div></font>";
exit();
}
$game = $GET['addmatch'];
$team = $GET['team'];
$odds = $_GET['odds'];
?>
this is shown at www.bigwagercasino.com/betting/matches.php
basically, i need it so that when a link is clicked it will register a session, then when another link is clicked it will also register this as a session. I need it like this so that the users can pick accumulators (ie different odds being multiplied together to get final odds)
in my sql table matches the following fields are there
team1 = home team
team2 = away team
odds1 = odds of team1
odds2 = odds of team2
drawodds = odds of draw
date = date of game
sport = sport
Help will be much appreciated
Evan Morgan