okay, i know you guys dont like giving direct answers, but i've tried this a couple of different ways and i just cant get it to work.. can some one please help? i would like to check my database for a user name to see if it already exists and if it does return some message like "already taken".
heres my script as is.:
<?
$db = mysql_connect("localhost","****","****");
mysql_select_db ("biohazard_login");
if(empty($username) || empty($passwd) || empty($firstname) || empty($lastname) || empty($email))
{
mysql_close($db);
die();
}
$result = mysql_query ("INSERT INTO biohazard_users (username, passwd, firstname, lastname, email, age, homepage, imservicename, aim, yahoo, icq)
VALUES ('$username', '$passwd', '$firstname', '$lastname', '$email', '$age', '$homepage', '$imservicename', '$aim', '$yahoo', '$icq')");
if(!$result)
{
echo "<b>There was a problem!</b> ", mysql_error();
exit();
}
if($result)
{
mysql_close($db);
print "Thank you for registering with Biohazard! you may now login!";
include("login.php");
}
?>