$query = mysql_query("SELECT * FROM users WHERE geek='1'");
while ($result = mysql_fetch_array($query)) {
switch ($result['gender']) {
case 'male':
$action = "handshake";
break;
case 'female':
$action = "hug";
$action2 = "roll";
$action3 = "hump";
$action4 = "kiss";
break;
default:
$action = "handshake";
}
if ($action == "handshake") {
perform_action_male($result['username'],$action);
} else {
perform_action_female($result['username'],$action,$action2,$action3,$action4);
}
}
mysql_free_result($query);
function perform_action_male($username,$a1) {
if ($a1 == "handshake") {
echo "/me shakes " . $username . "'s hand";
}
}
function perform_action_female($username,$a1,$a2,$a3,$a4) {
echo "/me " . $a1 . "s " . $username . ", then " . $a2 . "s around on the ground with her.\n";
echo "/me then " . $a3 . "s her furiously, and afterwards " . $a4 . "es her passionately";
}