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?

I need help (php & sql in events)
(1 viewing) (1) Guest
component
Go to bottomPage: 1
TOPIC: I need help (php & sql in events)
#9925
I need help (php & sql in events) 13 Years, 5 Months ago Karma: 0
plizzz...
I need help in writing a script in function onEndQuiz.
script should work with the DB with table #__users (SELECT, INSERT, UPDATE)

p.s.: sorry for my english... i'm from Russia.
The administrator has disabled public write access.
 
#9926
Re:I need help (php & sql in events) 13 Years, 5 Months ago Karma: 748
Hello,

You can place the following code into "onEndQuiz" handler:

Code:


$db =& JFactory::getDBO();
$user =& JFactory::getUser();

$db->setQuery('UPDATE #__users SET lastvisitDate = ' . $db->Quote($db->getNullDate()) . ' WHERE id = ' . $user->get('id'));
$db->query();



PS: If you need more assistance, let us know.

Regards,
ARI Soft
Last Edit: 2011/01/11 10:15 By admin.
The administrator has disabled public write access.
 
#9927
Re:I need help (php & sql in events) 13 Years, 5 Months ago Karma: 0
want to still get an array of SELECT
The administrator has disabled public write access.
 
#9928
Re:I need help (php & sql in events) 13 Years, 5 Months ago Karma: 748
Use the following code:

Code:


$db =& JFactory::getDBO();

$db->setQuery('SELECT * FROM #__users');
$users = $db->loadObjectList();



PS: Documentation of Joomla! database API can be found here.

Regards,
ARI Soft
The administrator has disabled public write access.
 
#9929
Re:I need help (php & sql in events) 13 Years, 5 Months ago Karma: 0
thank you very much
The administrator has disabled public write access.
 
Go to topPage: 1