If the user is requesting $requested_id, then...
$sql = "SELECT table_blah.id FROM table_blah WHERE table_blah.id='$requested_id'"
$results = mysql_query($sql);
if (empty(mysql_result($results, 0)))
{
echo "ID '$requested_id' is available.";
}
else
{
echo "Hey bozo, ID '$requested_id' is already taken.";
}
You may want to change the "Hey bozo" part.
Aaron Zoller
www.AaronZoller.com (Opening June 15th, 2002)