sheryprince Posted September 19, 2011 Share Posted September 19, 2011 Hello Friends.... I m in a trouble again..... the problem is that i am developing a student management system. every thing was going well bu now at this very moment i am stuck at point and can not find a way out... plz help me out! i am making a module which will keep the record of students test results and will be fetched as per need. the main problem is that i have three fields in the table where one have the total mark, second have the obtained marks and the third one is blank i want to take the percentage and place it in the third (Blank one) field..... My head is blowing out ...... friends PLZZZZZZZZZ help me out! :'( Quote Link to comment https://forums.phpfreaks.com/topic/247416-find-percentage/ Share on other sites More sharing options...
btherl Posted September 19, 2011 Share Posted September 19, 2011 Would it be Percentage = O / T * 100 Where O = obtained marks and T = total marks? Quote Link to comment https://forums.phpfreaks.com/topic/247416-find-percentage/#findComment-1270583 Share on other sites More sharing options...
sheryprince Posted September 19, 2011 Author Share Posted September 19, 2011 Thanks Btherl ! for you reply.... but plz coud you explain it a little more i m new to php and dont know so much plz help me out guyzzzzzzz! Quote Link to comment https://forums.phpfreaks.com/topic/247416-find-percentage/#findComment-1270603 Share on other sites More sharing options...
xyph Posted September 19, 2011 Share Posted September 19, 2011 guyzzzzzzz? By table, do you mean a database table or an HTML table? It's simple math. echo '%' . round( $obtained / $total * 100 ); Quote Link to comment https://forums.phpfreaks.com/topic/247416-find-percentage/#findComment-1270710 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.