How to execute an easy DB UPDATE SQL?

He Heller 13 Apr, 2013
Hello,

This is a great extension. I can use it in several ways.
Now I'm in a sit when I just should do an UPDATE command, when I'm click on a text.
Is there any way to send an SQL command like '
UPDATE `nnd_user_go` SET `used`=NOT `used` WHERE `user_id`=<?php $user =& JFactory::getUser(); echo $user->id; ?>
' to the MySQL server?

Thanks!
Gr GreyHead 13 Apr, 2013
Hi Heller,

You can use a Custom Code action
<?php
$user  =& JFactory::getUser();
$db    =& JFactory::getDBO();
$query = "
  UPDATE `nnd_user_go` 
    SET `used` = NOT `used` 
    WHERE `user_id` = {$user->id} ;
";
$db->setQuery($query);
$db->query();
?>

Bob
He Heller 16 Apr, 2013
Thx GreyHead!

Now I see, I can use Joomla! functions under the ChronoForm. 😀
This topic is locked and no more replies can be posted.