Jump to content
MakeWebGames

Recommended Posts

Posted

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:

Posted

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>";
}
}
Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...