- Impact
- 19
Hey
i have this code which alwayz gets the FIRST three matches...is there way of making it so it gets RANDOM 3 ?
i have this code which alwayz gets the FIRST three matches...is there way of making it so it gets RANDOM 3 ?
PHP:
<?
$country = $_GET['country'];
$searchpass = $_GET['searchpass'];
$dbusername="zubair";
$dbpassword="";
$database= "z_game";
if ($searchpass == "aa") {
mysql_connect(localhost, $dbusername, $dbpassword);
@mysql_select_db($database) or die("Unable to select database");
$sql = mysql_query("Select * From user where country = '".$country."' LIMIT 3") ;
while ($row = mysql_fetch_assoc($sql)) {
echo $row['username'] . "\n" ;
echo "?\n";
echo $row['health']. "\n" ;
echo "?\n";
echo $row['level']. "\n";
echo "?\n";
echo $row['money']. "\n";
echo "?\n";
}
}
else {
echo "error\n";
}
?>
Last edited by a moderator:






