<?php
$query = "SELECT lastgame FROM ldu_users WHERE user_name = '".$_POST['winner']."'";
$result = MySQL_query($query);
While( $rows = MySQL_fetch_array($result) ) {
$lg = $rows['lastgame'];
if ($lg = $_POST['loser']){
echo "<br>The last game you played was against this person. This game does not count!";
}else{
MySQL_query("UPDATE ldu_users SET lastgame = '".$_POST['winner']."' WHERE user_name = '".$_POST['loser']."'");
MySQL_query("UPDATE ldu_users SET lastgame = '".$_POST['loser']."' WHERE user_name = '".$_POST['winner']."'");
}
}
?>
OK, I can't seem to get this to work. Anybody know what I'm doing wrong?
All it says is that the game was against this person. It doesn't count. When really in the database, that's wrong