【问题标题】:How can i access the Vtiger Database object?如何访问 Vtiger 数据库对象?
【发布时间】:2017-07-07 15:16:19
【问题描述】:

我正在编写一个 php 脚本来将一些数据导入到我的自定义模块中,基本上我会定期运行一个 cron 作业来从另一个表中复制一些数据来填充我的自定义模块字段。

谢谢。

【问题讨论】:

  • 你的问题到底是什么。请您提供更多详细信息。
  • 虽然我在标题中提到了,但我仍然认为我应该在细节部分进行解释。很抱歉,但你处理得对。谢谢!

标签: crm vtiger vtigercrm


【解决方案1】:

使用 PearDatabase.php 类获取数据库访问和与数据库操作相关的功能。

示例:

<?php
include_once 'include/database/PearDatabase.php';
$db = PearDatabase::getInstance();
$result = $db->pquery("SHOW TABLES LIKE 'leads'", array());
echo $db->num_rows($result);
print_r($result);
echo "<br>Test Done <br>";


//Using $db object you can access other DB related methods defined in that class.
//Include the file in your module in any file where you want DB operation.
// But I would recommend, use inside your main module class or model controller class.
?>

将此 PHP 脚本放入您的根目录并使用您的浏览器直接运行此文件。所以你会有一些想法,你可以在你的模块中使用,因为所有模块都是从 index.php 文件(根目录)加载的。

【讨论】:

  • 谢谢!我正是需要这个。
猜你喜欢
  • 2020-02-26
  • 1970-01-01
  • 2011-09-18
  • 2021-11-02
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-12-07
  • 1970-01-01
相关资源
最近更新 更多