I can’t explain what i’m having a problem with easily but here it is,
i made it look for rows and their names but a button can’t see the difference between 2 arrays in a while function because you click it at the end i need a work arround to be able to see which array the button needs to change the number for, here is the code:
[php]$sql="SELECT * FROM anime WHERE username = ‘$username’ ";
$result=mysql_query($sql) or die(mysql_error());
while($rows=mysql_fetch_array($result))
{
if (isset($_POST[‘submit1’]))
{ mysql_query(“UPDATE anime SET episode=’$rows[episode]’+1 where name=’$rows[name]’ AND username=’$username’”) or die(“cannot send your password”);
header(“Location: {$_SERVER[‘HTTP_REFERER’]}”);
}
if (isset($_POST[‘submit2’]))
{ mysql_query(“UPDATE anime SET episode=’$rows[episode]’-1 where name=’$rows[name]’ AND username=’$username’”) or die(“cannot send your password”);
header(“Location: {$_SERVER[‘HTTP_REFERER’]}”);
}
?>
| anime: | <?php echo "$rows[name]"; ?> |
| episode: | <?php echo "$rows[episode]"; ?> |
i can’t explain it well i hope you can understand what i mean when you read the code, the name that changes is for both names because name=’$rows[name]’ is just all of the rows…
what kind of function or thing can be a workaround for this??