Re:Insert results in DB table after quiz finish 7 Years, 9 Months ago
|
Karma: 0
|
This is the code you provide for Ari Quiz 3
We have this so far inside quizcomplete.php
if ($resultInfo['_Passed'])
{
$query = "INSERT INTO `kxmk_ariquiz_students` (`students_name`, `students_certification`, `students_certification_number`, `students_country`, `students_date_passed`) VALUES('{$resultInfo['UserName']}', '{$resultInfo['QuizName']}', '{$resultInfo['StatisticsInfoId']}00', '{$resultInfo['EndDate']}')";
I want to add this to that code '{$resultInfo->CountryName}',
But is not working because the country name is from Virtuemart. But on Ari Quiz 2 we extract that data like this:
$query="SELECT #__ariquizstatisticsinfo.*,xxxx_virtuemart_countries.country_3_code AS 'CountryName',
CONCAT(CONCAT(#__ariquizstatisticsinfo.StatisticsInfoId,'0'),
#__virtuemart_userinfos.virtuemart_country_id AS 'Country',
FROM #__virtuemart_userinfos
JOIN xxxx_virtuemart_countries
ON xxxx_virtuemart_userinfos.virtuemart_country_id = xxxx_virtuemart_countries.virtuemart_country_id
WHERE #__virtuemart_userinfos.virtuemart_user_id=".$user->id."
order by #__ariquizstatisticsinfo.StatisticsInfoId desc limit 1";
So my question is how to implement this in Ari Quiz 3 in the above code
I send you the email with the full code from Ari Quiz 2
|
|
|
Last Edit: 2017/02/15 20:28 By niki.
|
|
Re:Insert results in DB table after quiz finish 7 Years, 9 Months ago
|
Karma: 760
|
Could you explain what problem with the second query? "ARI Quiz" contains #__ariquizstatisticsinfo table which is used in it, according to the query other data is loaded from VirtueMart tables so if VirtueMart tables the same, the query should work.
Regards,
ARI Soft
|
|
|
|
|
Re:Insert results in DB table after quiz finish 7 Years, 9 Months ago
|
Karma: 0
|
I try it like this
if ($resultInfo['_Passed'])
{
$query = "INSERT INTO `kxmk_ariquiz_students` (`students_name`, `students_certification`, `students_certification_number`, `students_country`, `students_date_passed`) VALUES('{$resultInfo['UserName']}', '{$resultInfo['QuizName']}', '{$resultInfo['StatisticsInfoId']}00', '{$resultInfo->CountryName}', '{$resultInfo['EndDate']}')";
$query="SELECT #__ariquizstatisticsinfo.*,xxxx_virtuemart_countries.country_3_code AS 'CountryName',
But is not working. That's why i'm asking you hot to put it the correct way?
|
|
|
|
|
Re:Insert results in DB table after quiz finish 7 Years, 9 Months ago
|
Karma: 760
|
Sent the query by email.
Regards,
ARI Soft
|
|
|
|
|
|