Please post all pre-sales questions of all products on this forum

PHP Script to update a different table

  • Takalani
  • Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 1 month ago #101992 by Takalani
PHP Script to update a different table was created by Takalani
Hi,

I want to update a field in another table using the PHP plugin after activation:
Code:
$userid = $row->user_id; $db = JFactory::getDbo(); $query = $db->getQuery(true); $fields = array( $db->quoteName('status') . ' = Active' ); $conditions = array( $db->quoteName('id') . ' = '.$userid); $query->update($db->quoteName('#__other_user_table'))->set($fields)->where($conditions); $db->setQuery($query); $db->execute();

Nothing happens. What am I missing?

Please Log in or Create an account to join the conversation.

More
8 years 1 month ago #102027 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic PHP Script to update a different table
Could you please attach a screenshot of the code you entered into the plugin? I want to see what even you are using

Subscription Stored Script

Or

Subscription Active Script

before answering you further

Maybe you can submit a support ticket sending us super admin account of your site so that we can check it directly on your site

Regards,

Tuan

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham NgocGiang Dinh TruongDang Thuc Dam