MemphiS Posted June 12, 2007 Share Posted June 12, 2007 Example: <?php $total_rows = mysql_num_rows(mysql_query("SELECT `id` FROM `users` WHERE `accepted` = '1'")); // 1 rows $total = mysql_num_rows(mysql_query("SELECT `id` FROM `users`")); // 2 rows $roundoff = round($total_rows / $total); echo("$roundoff"); What i want this to get at is 50% as there is two "total" rows and only 1 accepted. Not to sure how i should code it. Thanks for any replys Link to comment https://forums.phpfreaks.com/topic/55228-maths-in-php/ Share on other sites More sharing options...
only one Posted June 12, 2007 Share Posted June 12, 2007 thats simple.. $roundoff = round($total_rows / 100) * $total; Link to comment https://forums.phpfreaks.com/topic/55228-maths-in-php/#findComment-272994 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.