Hi, my code bassically allows a user to add their username by clicking a button. (the username is given through a phpbb function) A table is then displayed with al the results. This is working fine, but my error has come up when trying to stop users registering if they already exist on the database. I did this by having a loop which will set $stat = '1'; only if the userrname is the same, people can only press the register button while $stat = '0'; The problem is, $stat never seems to be set to 1, even though i know both values which i am comparing are equal. I echo them both and they are both the same, but my if ($usr == $username){ $stat = '1';} never seems to get through I have attached my code. Please help P.S. I know its a mess ;) [attachment deleted by admin]