Forgot to mention that im a beginer, il tell you what i inderstand onf the script //THIS SCRIPT ASSUMES THAT YOUR RATINGS ARE ALWAYS NUMERIC //IT WILL WORK WITH NON-DIGIT DATA TYPES BUT THERE ARE OTHER THINGS TO CONSIDER WHEN //DEALING WITH THE COMPARISION OF ALNUM OR ALPHA CHARS <?php [b]This is where it gets the score to place the list down in order of closeness[/b] $i = 0; [b]gets the results from mysql database[/b] $sql = mysql_query("SELECT rate_col FROM thing_table"); [b]This kind of converts it to $row variable[/b] while ($row = mysql_fetch_array($sql)) { [b]This is to say if the number from there databse is greater then the $i varable[/b] if ($row['rate_col'] > $i) { [b]This tells the script to say the row of results[/b] $i = $row['rate_col']; } //END WHILE } [b]This prints the results[/b] //$i CONTAINS THE GREATEST ( OR HIGHEST) VALUE OF THE RATE COL IN THE THING TABLE echo $i; ?> Am i correct in waht i sat above in bold ? also how is the connection made to the database ? thanks