Joshua Posted October 8, 2009 Share Posted October 8, 2009 I'm trying to get this 100% but it's always 99% What I want it to do I want it to set the Users Race in the Database upon registration and depending on that race send them to a certain City. I can get it to Do one or the other but not both If i change some things up it inserts their ID into userstats but sends them to wrong city If I change other things up, it sends them to right city but won't Insert them into Userstats ANY help would be appreciated $db->query("INSERT INTO users (username, login_name, userpass, level, money, crystals, donatordays, user_level, energy, maxenergy, will, maxwill, brave, maxbrave, hp, maxhp, location, gender, signedup, email, bankmoney, lastip, lastip_signup, race) VALUES( '{$username}', '{$username}',md5('{$_POST['password']}'), 1, $sm, 0, 0, 1, 12, 12, 100, 100, 5, 5, 100, 100, 1, '{$_POST['gender']}', unix_timestamp(), '{$_POST['email']}', -1, '$IP', '$IP', '{$_POST['race']}' )"); $i=$db->insert_id(); if('race'==1) { $db->query("INSERT INTO userstats VALUES('$i', 10, 10, 50, 10, 10, 10)"); $db->query("UPDATE users SET location=3 WHERE username='$username'"); } elseif('race'==2) { $db->query("INSERT INTO userstats VALUES('$i', 10, 50, 10, 10, 10, 10)"); $db->query("UPDATE users SET location=1 WHERE username='$username'"); } elseif('race'==3) { $db->query("INSERT INTO userstats VALUES('$i', 50, 10, 10, 10, 10, 10)"); $db->query("UPDATE users SET location=2 WHERE username='$username'"); } Quote Link to comment Share on other sites More sharing options...
Danny696 Posted October 8, 2009 Share Posted October 8, 2009 use $_POST['race'] Quote Link to comment Share on other sites More sharing options...
Joshua Posted October 8, 2009 Author Share Posted October 8, 2009 oo that worked <3 danke Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.