eh... my script is all screwed up... i go the view page all done right but when i want it to add a user and i do it it doesnt check to see if the username allready exists and it adds it MANY times instead of once... whats wrong with my coding??
<?php
//mySQL connection//
$hostname = "localhost";
$userdbname = "*";
$passdbword = "*";
$database = "altschu_c3";
mysql_connect($hostname,$userdbname,$passdbword) or die ("Couldn't connect to mySQL");
mysql_select_db($database);
$happen = mysql_query("SELECT username FROM usersdb");
while($rowsix = mysql_fetch_array($happen))
if($uname == $rowsix[username])
{
echo ("username taken, go back");
}
else
{
$query1 = "INSERT INTO usersdb (ID, username, password, email) VALUES (NULL, '".$REQUEST['uname']."', '".$REQUEST['pass']."', '".$_REQUEST['email']."')";
$result = mysql_query($query1);
echo($result);
echo("Thank you for signing up.");
}
if(!$result)
{
echo mysql_error();
}
?>