thewhat Posted January 22, 2008 Share Posted January 22, 2008 $userid = ($data['user_id']); if ($userdata['attacking_wars'] == 0) ( $dbquery5 = "UPDATE ".$db_prefix."users SET attack_1= '$userid' WHERE user_id='".$data['user_id']."'" ) ; if ($userdata['attacking_wars'] == 1) ( $dbquery6 = "UPDATE ".$db_prefix."users SET attack_2= '$userid' WHERE user_id='".$data['user_id']."'" ) ; if ($userdata['attacking_wars'] == 2) ( $dbquery7 = "UPDATE ".$db_prefix."users SET attack_3= '$userid' WHERE user_id='".$data['user_id']."'" ) ; I'm doing something wrong because it never updates. I just need it to properly connect. :\ Quote Link to comment https://forums.phpfreaks.com/topic/87231-solved-how-could-i-do-this-lots-of-if-statements/ Share on other sites More sharing options...
revraz Posted January 22, 2008 Share Posted January 22, 2008 Change your lines from if ($userdata['attacking_wars'] == 0) ( $dbquery5 = "UPDATE ".$db_prefix."users SET attack_1= '$userid' WHERE user_id='".$data['user_id']."'" ) ; to if ($userdata['attacking_wars'] == 0) { $dbquery5 = "UPDATE $db_prefix users SET attack_1= '$userid' WHERE user_id='".$data['user_id']."'"; } What is the tablename, like prefixusers? Quote Link to comment https://forums.phpfreaks.com/topic/87231-solved-how-could-i-do-this-lots-of-if-statements/#findComment-446203 Share on other sites More sharing options...
thewhat Posted January 22, 2008 Author Share Posted January 22, 2008 Yeah. All the variables are properly set and all. Thank you, let me try this out and get back to you. Quote Link to comment https://forums.phpfreaks.com/topic/87231-solved-how-could-i-do-this-lots-of-if-statements/#findComment-446209 Share on other sites More sharing options...
kenrbnsn Posted January 22, 2008 Share Posted January 22, 2008 Please post more of your code, especially where you are actually doing the mysql_query() call. Ken Quote Link to comment https://forums.phpfreaks.com/topic/87231-solved-how-could-i-do-this-lots-of-if-statements/#findComment-446211 Share on other sites More sharing options...
thewhat Posted January 22, 2008 Author Share Posted January 22, 2008 Well it worked. That was the entire code anyway, really. Minus a few variable definitions. Topic solved. Quote Link to comment https://forums.phpfreaks.com/topic/87231-solved-how-could-i-do-this-lots-of-if-statements/#findComment-446254 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.