PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I have this form where user can add there steam_id to the database - I need so that if they allready have add it 1 time - they can`t change it - and better if it tjek the database to see if the number is in use.
if(($steam_check > 0)){
echo "Please fix the following errors: <br />";
if($steam_check > 0){
echo "The steam_id you have selected has already been used by another member in our database. Please choose a different Username!<br />";
}
exit(); // exit the script so that we do not create this account!
}
$query = "SELECT * FROM table WHERE STEAMID = '$_POST[steam_id]'";
$result = mysql_query($query) or die (mysql_error());
$check = mysql_num_rows($result);
if ($check >= 1)
{
// this guy is already in the database
// do nothing
}
else
{
// this guy isnt in the database
// run an insert command
}
$query = "SELECT * FROM table WHERE STEAMID = '$_POST[steam_id]'";
$result = mysql_query($query) or die (mysql_error());
$check = mysql_num_rows($result);
if ($check >= 1)
{
echo "Please fix the following errors: <br />
The steam_id you have selected has already been used by another member in our database. Please choose a different Username!<br />";
}// this guy isnt in the database
else
{
// run an insert command
}
Change your script to this is what malcolmboston means.
and PLZ use the php button not code for php syntax