Speak now
Please Wait Image Converting Into Text...
Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Challenge yourself and boost your learning! Start the quiz now to earn credits.
Unlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
Course Queries Competitions/Entrance Exams 2 years ago
Posted on 16 Aug 2022, this text provides information on Competitions/Entrance Exams related to Course Queries. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.
Turn Your Knowledge into Earnings.
Hey guys I want to make an academic-oriented matching website that allows boys and girls to find their potential partners through academic performance and hobbies.
I was just thinking about convert quantity of exam grades eg. A, B, C and convert them into leagues like S-class, A-class. First I want to convert exam grade A into integer of 5, exam grade B into integer of 4 and so on. Then I sum them up and classify them into their respective classes.
The original and tiring code... I'm not sure whether it's going to work.
$obtaindata = mysql_fetch_assoc(mysql_query('SELECT * FROM userinfo WHERE primaryemel="' . $_COOKIE['smkdtuser'] . '"')); $pmrresults = json_decode($obtaindata['pmr']); $spmresults = json_decode($obtaindata['spm']); $upsresults = json_decode($obtaindata['upsr']); function calculateClassForPMR ($pmrresults) { $aquality = (int)$pmrresults['a'] * 5; $bquality = (int)$pmrresults['b'] * 4; $cquality = (int)$pmrresults['c'] * 3; $dquality = (int)$pmrresults['d'] * 2; $gquality = (int)$pmrresults['g'] * 1; $additup = $aquality + $bquality + $cquality + $dquality + $gquality; //Classify sum of scores to their respective class if ($additup => 35) {$classified = "s";} elseif ($additup >= 29 && $additup <= 34) {$classified = "a";} elseif ($additup >= 23 && $additup <= 28) {$classified = "b";} elseif ($additup >= 17 && $additup <= 22) {$classified = "c";} elseif ($additup >= 11 && $additup <= 16) {$classified = "d";} elseif ($additup >= 0 && $additup <= 10) {$classified = "e";} else {$classified = "wtf";}; return $classified; }
Don't blame me though ,I was just started learning php and try to do something weird...
Any replies or comments are highly appreciated.
when using json_decode i assume that you have {"a":1,"b":2,"c":3,"d":4,"e":5} something like this containt in that tabel row. Try to use :
{"a":1,"b":2,"c":3,"d":4,"e":5}
$pmrresults = var_dump(json_decode($obtaindata['pmr'], true)) then you can use $pmrresults['a'];
$pmrresults = var_dump(json_decode($obtaindata['pmr'], true))
$pmrresults['a'];
You have to json_encode() when you store values to DB
json_encode()
I don't want to rent another server just to test it... it's costly. ... user XAMPP it's free for testing.
I don't want to rent another server just to test it... it's costly.
No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.
Course Queries 4 Answers
Course Queries 5 Answers
Course Queries 1 Answers
Course Queries 3 Answers
Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.