abhikerl Posted June 12, 2008 Share Posted June 12, 2008 calculate average from rows in a database hi, can anyone tell me how to calculate the average of data retrieves from a database. The situation is I have a table "number" which consist of several data like "2,5,4,8,6...." I want to calculate the average and display it on the browser. thanks in advance for your help. http://www.islandinfo.mu Hi, I have a 2 tables: category, subCategory Can anyone explained me how to create a menu like a tree menu except there won't be any collapsible feature. for example Food(category) meat(sub) fruits(sub) vegetables(sub) Furniture(category) chair(sub) tables(sub) bed(sub) as you see, I want to display the category and under the category, I want to display the sub. I am using a database for that so that I can put other items without going through the code. I tried a lot but couldn't do it. Any help will be grateful. Thanks a lot http://www.islandinfo.mu Link to comment https://forums.phpfreaks.com/topic/109880-create-a-menu/ Share on other sites More sharing options...
MatthewJ Posted June 12, 2008 Share Posted June 12, 2008 SELECT avg( field ) FROM `table` Link to comment https://forums.phpfreaks.com/topic/109880-create-a-menu/#findComment-563827 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.