Hazard Posted February 10, 2009 Posted February 10, 2009 I have some experience in php but this is driving me insane! The Gang Crimes do not seem to appear when trying to commit a crime. I have searched all over the CE forums and no-body seems to have a simple and correct answer. Anyway, here's my code: print "<h3>Organised Crimes</h3> <form action='yourgang.php?action=staff&act2=crimes' method='post'>Choose a crime that your gang should commit. <select name='crime' type='dropdown'>"; $cnt=$db->query("SELECT username FROM users WHERE gang={$gangdata['gangID']}"); $membs=$db->num_rows($cnt); $q=$db->query("SELECT * FROM orgcrimes WHERE ocUSERS <= $membs"); while($r=$db->fetch_row($q)) { print "<option value='{$r['ocID']}'>{$r['ocNAME']} ({$r['ocUSERS']} members needed)</option>"; } print "</select> <input type='submit' value='Commit' /></form>"; } } If I'm missing something really noobish you can slap me :wink: Quote
Haunted Dawg Posted February 10, 2009 Posted February 10, 2009 Re: Gang Crimes - Help Needed (Please Read) Do you have the required amount of gang member's? Try this: print "<h3>Organised Crimes</h3> <form action='yourgang.php?action=staff&act2=crimes' method='post'>Choose a crime that your gang should commit. <select name='crime' type='dropdown'>"; $cnt=$db->query("SELECT username FROM users WHERE gang={$gangdata['gangID']}"); $membs=$db->num_rows($cnt); $q=$db->query("SELECT * FROM orgcrimes WHERE ocUSERS <= $membs"); if(mysql_num_rows($q) == 0) { echo '<option value="">Not enough members</option>'; } else { while($r=$db->fetch_row($q)) { print "<option value='{$r['ocID']}'>{$r['ocNAME']} ({$r['ocUSERS']} members needed)</option>"; } } print "</select> <input type='submit' value='Commit' /></form>"; } } Quote
Hazard Posted February 10, 2009 Author Posted February 10, 2009 Re: Gang Crimes - Help Needed (Please Read) Yep that fixed. I knew I was missing something simple. Cheers killah! I hope this helps many other people. Quote
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.