Before I added the "Male" or "Female" part... this worked PERFECTLY - now it doesn't work at all... Its supposed to check the user's post count, and whether they're male or female - then assign them a title matching their sex and post count.
$user2 = $_SESSION['user'];
$getname2 = mysql_query("SELECT * FROM login WHERE user='$user2'");
while ($namer2 = mysql_fetch_array($getname2, MYSQL_ASSOC)){
$posts1 = mysql_query("SELECT * FROM title WHERE sex='Male'");
$posts2 = mysql_query("SELECT * FROM title WHERE sex='Female'");
while ($titlep = mysql_fetch_array($posts1, MYSQL_ASSOC)) {
while ($titlep2 = mysql_fetch_array($posts2, MYSQL_ASSOC)) {
if ($namer2['posts'] >= $titlep['minposts'] && $namer2['posts'] <= $titlep['maxposts']) {
$titlen = $titlep['title'];
mysql_query("UPDATE login SET title='$titlen' WHERE user='$user', sex='male'");
}
else if ($namer2['posts'] >= $titlep2['minposts'] && $namer2['posts'] <= $titlep2['maxposts']) {
$titlen = $titlep2['title'];
mysql_query("UPDATE login SET title='$titlen' WHERE user='$user', sex='Female'");
}