Okay, next issue! I'm having the issue of the characters changing when I refresh the page. I have included, in the database, a field where it records what character they have, or were fighting, but no matter what It try, it still changes characters upon refresh. Is there anyway to stop this from occurring? Below is code. Thank you...
Code: Select all
if (isset($_GET['characters']))
{
$characters=$_GET['characters'];
$charactersinfo = "SELECT * from stats where creature = '$creature'";
$charactersinfo2 = mysql_query($charactersinfo) or die ("Could not get the character you were fighting!");
$charactersinfo3 = mysql_fetch_array($charactersinfo2);
} else {
$areaninfo="SELECT * from locations where type='arena' AND location = '$stats[location]'";
$areaninfo2=mysql_query($areaninfo) or die("could not get arena");
$areaninfo3=mysql_fetch_array($areaninfo2);
$arenalevel = $areaninfo3['level'];
$charactersinfo = "SELECT * from characters where level = '$arenalevel' order by rand() limit 1";
$charactersinfo2 = mysql_query($charactersinfo) or die ("Could not get a character!");
$charactersinfo3 = mysql_fetch_array($charactersinfo2);
$id = $stats['id'];
$cid = $charactersinfo3['id'];
$updateplayer="update stats set creature='$cid' where id='$id'";
mysql_query($updateplayer) or die("Could not update player");