Hi everybody,
I just built a PHP-based site and i set up everything, except the page where the users can modify their informations.
Here's what my tables look likes:
1st table :
username
location
(...)
clanname
2nd table :
clanname
clantag
regdate
When the user's updating his informations, first i'm verifying, if he entered a new clan, if it's already registered. Second i wanna, if he left a clan and there are no more users registered with it, delete the row.
Here's what my php code looks like :
$check_if_update_clan_exists = mysql_query("SELECT * FROM clans WHERE clanname='$_POST[update_clanname]'");
$check_if_old_clan_is_empty = mysql_query("SELECT * FROM users WHERE clanname='$session_clanname'");
if(mysql_num_rows($check_if_update_clan_exists) < 1){
mysql_query("UPDATE (...)");
if(mysql_num_rows($check_if_old_clan_is_empty) < 1){
mysql_query("DELETE FROM clans WHERE clanname='$session_clanname'");
echo "Vos informations ont été mises-à-jour!2";
}
else{
echo "Vos informations ont été mises-à-jour3!";
}
}
else{
echo "Vos informations ont été mises-à-jour!4";
}
The part where it's looking if the clan is empty isn't working ... could anyone help me?