本文整理匯總了PHP中Update::update方法的典型用法代碼示例。如果您正苦於以下問題:PHP Update::update方法的具體用法?PHP Update::update怎麽用?PHP Update::update使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Update
的用法示例。
在下文中一共展示了Update::update方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: User
$lng->set($_COOKIE['LANG']);
require_once $root . 'lib/user.php';
require_once $root . 'lib/cash.php';
require_once $root . 'lib/update.php';
if ($debug) {
$db->debug = true;
}
$usr = new User($db, $lng);
$usr->auth();
$upd = new Update($db, $lng, $usr);
$ch = new Cash($db, $usr, $lng);
$settings['version'] = $version;
$settings['demo'] = $demo;
$settings['debug'] = $debug;
$settings['static'] = $static;
$settings['extjs'] = $extjs;
$settings['ocr_host'] = $ocr_host;
//setup or update
$settings['setup'] = 0;
$settings['update'] = 0;
if ($upd->needSetup()) {
$settings['setup'] = 1;
$settings['site_name'] = $lng->get(213);
} else {
if ($upd->needUpdate()) {
/*$settings['update'] = 1;
$settings['site_name'] = $lng->get(219);*/
$upd->update();
}
$settings = array_merge($settings, $ch->getSettings());
}
示例2: getQuery
public static function getQuery($tableID, $setArr, $whereArr = NULL, $obj = NULL)
{
$obj['returnQuery'] = true;
$api = new Update($tableID, $setArr, $whereArr, $obj);
return $api->update();
}
示例3: testUpdate
public function testUpdate()
{
$update = new Update($this->driver);
$update->update('table')->set('a', '?')->set('b', '?')->values(['c' => '?', 'd' => '?'])->where('c=d');
$this->assertEquals('UPDATE table SET a=?, b=?, c=?, d=? WHERE c=d', $update->get());
}