本文整理汇总了PHP中Vtiger_Utils::SQLEscape方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Utils::SQLEscape方法的具体用法?PHP Vtiger_Utils::SQLEscape怎么用?PHP Vtiger_Utils::SQLEscape使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vtiger_Utils
的用法示例。
在下文中一共展示了Vtiger_Utils::SQLEscape方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CheckTable
/**
* Check if table is present in database
* @param String tablename to check
*/
static function CheckTable($tablename) {
global $adb;
$old_dieOnError = $adb->dieOnError;
$adb->dieOnError = false;
$tablename = Vtiger_Utils::SQLEscape($tablename);
$tablecheck = $adb->pquery("SHOW TABLES LIKE ?", array($tablename));
$tablePresent = true;
if(empty($tablecheck) || $adb->num_rows($tablecheck) === 0)
$tablePresent = false;
$adb->dieOnError = $old_dieOnError;
return $tablePresent;
}
示例2: CheckTable
/**
* Check if table is present in database
* @param String tablename to check
*/
static function CheckTable($tablename)
{
global $adb;
$old_dieOnError = $adb->dieOnError;
$adb->dieOnError = false;
$tablename = Vtiger_Utils::SQLEscape($tablename);
$tablecheck = $adb->pquery("SELECT 1 FROM {$tablename} LIMIT 1", array());
$tablePresent = true;
if (empty($tablecheck)) {
$tablePresent = false;
}
$adb->dieOnError = $old_dieOnError;
return $tablePresent;
}