There is a list of publications, books ... Each such book has 2 values, view = views and like = like .
An example of my code displays entries not as it is correct, I don’t know exactly how you made such output schemes, could you suggest how to properly make such top records at all?
This is actually the request for output from the database:
$sql_top_view = mysql_query(" SELECT COUNT(id) FROM `book` WHERE `view`>='$book[view]' AND `like`>='$book[like]' ORDER BY `view` , `like` LIMIT 1000"); $top_view = mysql_fetch_row($sql_top_view); $top = $top_view[0]; if($top >= 1000){ $top_number_view = '1000+'; }else{ $top_number_view = $top; } echo $top_number_view; This code outputs data like this:
1 место: 7 like , 289 view. 1 место: 9 like , 268 view. 1 место: 17 like , 233 view. 4 место: 7 like , 78 view. и.т.д. But you must:
1 место: 7 like , 289 view. 2 место: 9 like , 268 view. 3 место: 17 like , 233 view. 4 место: 7 like , 78 view. и.т.д. But I was also interested in how you can make the like more important than the view, for example, 1 like = 20 view, and if you get a book with a value of 1 like and another with 10 like, then put the first book in the first place?
20*like+view- Mike