【问题标题】:How to update a table in SocialEngine如何在 SocialEngine 中更新表格
【发布时间】:2019-01-26 04:48:33
【问题描述】:

我知道 SocialEngine 中的一个表的访问方式如下:

Engine_Api::_()->getDbTable('table_name','plugin_name');   

例如,要访问 users 表,我们使用:

Engine_Api::_()->getDbTable('users', 'user');

我的问题是我们如何更新表格。 SocialEngine 中有哪些 API 和方法可以执行此操作?

换句话说,我们如何在 SocialEngine 中实现以下 SQL 查询的功能?

UPDATE `engine4_users` SET `phone_number`='12345678' WHERE `user_id`='15'

【问题讨论】:

    标签: php mysql zend-framework socialengine


    【解决方案1】:

    请在您的函数中使用以下查询。

    $userTable= Engine_Api::_()->getDbtable('users', 'user');

                    $userTable->update(array(
                    'phone_number' =>'12345678',
                    ), array(
                    'user_id = ?' => '15',
    
                    ));
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-08-20
      • 2020-01-05
      • 2016-10-20
      • 2012-10-23
      • 2013-07-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多