- First I've attached the original PHP file, which you will need. This file is included in a page.
- Second, sorry for my english, this is not my primary language
Ok, the page I've attached currently dont sort the casinos: http://www.mescasinos.net/meilleurs-casinos.php
In my webpage, you can see the rating with the stars, this rating is made by mathematic (line 45):
Code: Select all
$number = ($row['note_rep'] + $row['note_graph'] + $row['note_bmatch'] + $row['note_bmax'] + $row['note_bgratuit'] + $row['note_jackpot'] + $row['note_varjeux'] + $row['note_languages'] + $row['note_bloyauter'] + $row['note_jeuxmulti'] + $row['note_metpaiement'] + $row['note_metretrait'] + $row['note_support'])/13;
Normaly, to get something sorted i use:
Code: Select all
$result = mysql_query("SELECT * FROM casinos ORDER BY something DESC");This is how i think the things must be but im not sure if thats the good way to make it:
make the average of all the fields "note_" for each casinos in my table named "casinos" and sort them after
Example:
Code: Select all
Table "casinos"
nom note_rep note_graph note_support [...]
-------------------------------------------------------------------------------------
tropez 9 6 6
-------------------------------------------------------------------------------------
rushmore 8 7 9
-------------------------------------------------------------------------------------
bellini 9 9 9
-------------------------------------------------------------------------------------
The average of tropez is 7.6
The average of rushmore is 8
The average of bellini is 9bellini
rushmore
tropez
I hope you guys understand what i want say