I want to add up all the views for each users profile and display it on the homepage. The Mysql stucture is like this.. Databasename: msn_Socialsite Then the table : Users Then the sub table : views The views table just has a number in it. how would i add all the views togetherer and display on a seprate page with php? could someone show me the code? thanks loads!
Hmm $sql = "SELECT *,(SELECT COUNT(*) FROM views WHERE userid = Users.id) AS userviews FROM users ORDER BY userviews DESC PHP: Dont know your fields but this should get u started.
sillysoft, thanlks for the attempt, but i have no clue how to implement that code you gave me :S it's not a valid php code.