<?php
$uname = "0";
$db = mysql_connect("localhost","username","password");
mysql_select_db("sevengfx_com_-_hosted" , $db) or die("Couldn't open $db: ".mysql_error());
$sql = "SELECT * FROM support_users";
$result=mysql_query($sql);
while ($row = mysql_fetch_array($result)){
if ($username == $row['username']{
while ($uname != "1"){
echo '<font color="red">That username is already taken. Please create a new one.</font>';
$_SESSION['used'] = "1";
include 'form.php';
$uname = "1";
} else {
}
}
?>
Im checking to see if there is a username already registered that is the same as the user put in. I want it so that once it finds that it is taken, it will stop. When I use this code i get