$r = mysql_query ( "SELECT guid FROM characters" );
if (mysql_num_rows($r) != 0) {
while ( $row == mysql_fetch_array ( $r ) ) {
$cap = rand ( 0, $char );
if ($row ['guid'] != $cap) {
$captain = rand ( 0, $char );
}
}
} else {
$captain = rand ( 0, $char );
}
This code should return me the guid of character, which is not recorded in the characters table yet. The first part with if works, but the loop doesn't work at all, I tried to add print "text"; in it but it didn't return nothing.