Monday, June 30, 2014

PERCENT FROM MYSQL

PERCENT FROM MYSQL

mysql_select_db("freeskat_promail") or die(mysql_error());
$result = mysql_query("SELECT *
FROM `users`
WHERE `user8` LIKE '%Georgia%'
");
$num_rows = mysql_num_rows($result);
echo $num_rows - Georgia\n;
?>



mysql_select_db("freeskat_promail") or die(mysql_error());
$result = mysql_query("SELECT user8, COUNT(*) AS Total, SUM(in) AS TotalIn, SUM(in)*100/COUNT(*) AS Percent FROM lm_users GROUP BY user8
");
$num_rows = mysql_num_rows($result);
echo $num_rows \n; 
?>

No comments:

Post a Comment