Hey, no error as such. Script's just not doing what it's meant to do.
<?php
$addname = $_GET['name'];
?>
<?php
if ($_GET['step'] == '1')
{
$db=mysql_connect("localhost", dbusername, dbpassword);
$sql="INSERT INTO leaguetable ( playername , wins , draws , losses , deadline , points , division ) VALUES ('$addname', '0', '0', '0', '0', '0', '0')";
$result = mysql_query($sql, $db);
echo "Username <b>$addname</b> has been inserted into the league";
echo "<a href='?name=$addname&step=2'>Next</a>";
}
elseif ($_GET['step'] == '2')
{
$db2=mysql_connect("localhost", dbusername, dbpassword);
$sql2="DELETE FROM `waitinglist` WHERE `username` = '$addname'";
$result = mysql_query($sql2, $db2);
echo "Username <b>$addname</b> Has been removed from the waiting list";
echo "<a href='index.php'>Home</a>";
}
else
{
echo "error: the link you have followed is either out of date or you've typed the address wrong!"; } ?>
waitinglist - the table storing all names on the waiting list.
leaguetable - table storing league names.
step1 - the step which is MEANT to add the name to the league by using the ?name tag. (?name is the name involved)
Step2 - the step which removes the name from the waiting list.
I get the text... username removed from waiting list.. inserted to league, but nothing actually happens to the database etc.
Looking at the code are there any possibilites why it doesn't work?
Again sorry for wasting your time!
nicknax