Home News Contact Us Forum About Us Demos Products F.A.Q.
Shopping Cart
You currently have 0 items in your cart.


Recent Events
  • 31/12/2023 New Year SALE

    We are glad to announce New Year SALE. 25% discount for all our extensions. Use NY24 coupon code. Hurry up the discount is valid till 7 January.

  • 21/11/2023 BLACK FRIDAY 23 is coming

    BIG SALE, 35% discount for all our extensions. Use BF23 coupon code. Hurry up the discount is valid till 27 November.


2Checkout.com, Inc. is an authorized retailer of goods and services provided by ARI Soft. 2CheckOut




Follow us on twitter



Welcome, Guest
Please Login or Register.    Lost Password?

Insert results in DB table after quiz finish
(1 viewing) (1) Guest
component
Go to bottomPage: 1234
TOPIC: Insert results in DB table after quiz finish
#59664
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.
The administrator has disabled public write access.
 
#59674
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
The administrator has disabled public write access.
 
#59679
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?
The administrator has disabled public write access.
 
#59693
Re:Insert results in DB table after quiz finish 7 Years, 9 Months ago Karma: 760
Sent the query by email.

Regards,
ARI Soft
The administrator has disabled public write access.
 
Go to topPage: 1234