本文整理匯總了PHP中DBC::queryOneAssoc方法的典型用法代碼示例。如果您正苦於以下問題:PHP DBC::queryOneAssoc方法的具體用法?PHP DBC::queryOneAssoc怎麽用?PHP DBC::queryOneAssoc使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DBC
的用法示例。
在下文中一共展示了DBC::queryOneAssoc方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: validate
public function validate(&$data, $single = false)
{
$p = DBC::queryOneAssoc("\n\t\t\tSELECT p_id\n\t\t\tFROM wog_player\n\t\t\tWHERE p_id={$data['p_id']}\n\t\t");
if (!$p) {
alert('玩家不存在');
}
}
示例2: load
public function load()
{
if (!$this->hasPrimaryKey()) {
return false;
}
$p = DBC::queryOneAssoc('SELECT * FROM ' . $this->tablename . ' WHERE ' . $this->pkFilterSQL());
if (!$p) {
return;
}
extendObject($this, $p);
}
示例3: validate
public function validate(&$data, $single = false)
{
$p = DBC::queryOneAssoc('
SELECT p_id, p_name
FROM wog_player
WHERE p_name="' . $data['p_name'] . '"
');
if ($p && (!is_numeric($this->pk['p_id']) || $p['p_id'] != $this->pk['p_id'])) {
alert('玩家名稱重複');
}
if (!$single) {
return;
}
}
示例4: validate
public function validate(&$data, $single = false)
{
$p = DBC::queryOneAssoc("\n\t\t\tSELECT p_id\n\t\t\tFROM wog_player\n\t\t\tWHERE p_id={$data['p_id']}\n\t\t");
if (!$p) {
alert('玩家不存在');
}
$ex = DBC::queryOneAssoc("\n\t\t\tSELECT ex_id\n\t\t\tFROM wog_exchange_main\n\t\t\tWHERE ex_id={$data['ex_id']}\n\t\t");
if (!$p) {
alert('資源不存在');
}
$el = DBC::queryOneAssoc("\n\t\t\tSELECT el_id\n\t\t\tFROM wog_exchange_list\n\t\t\tWHERE ex_id={$data['ex_id']} AND p_id={$data['p_id']}\n\t\t");
//新增已存在的p_id:ex_id pair或修改成已存在的p_id:ex_id pair時顯示錯誤
if ($el && (in_array(null, $this->pk, true) || $el['el_id'] != $this->pk['el_id'])) {
alert('已有此資源');
}
}
示例5: validate
public function validate(&$data, $single = false)
{
if ($data['p_id'] == $data['f_id']) {
alert('不能將自己加為好友');
}
$p = DBC::queryOneAssoc("\n\t\t\tSELECT p_id\n\t\t\tFROM wog_player\n\t\t\tWHERE p_id={$data['p_id']}\n\t\t");
if (!$p) {
alert('玩家不存在');
}
$p = DBC::queryOneAssoc("\n\t\t\tSELECT p_id\n\t\t\tFROM wog_player\n\t\t\tWHERE p_id={$data['f_id']}\n\t\t");
if (!$p) {
alert('好友不存在');
}
$p = DBC::queryOneAssoc("\n\t\t\tSELECT p_id\n\t\t\tFROM wog_friend_list\n\t\t\tWHERE p_id={$data['p_id']} AND f_id={$data['f_id']}\n\t\t");
if ($p && (in_array(null, $this->pk, true) || $this->pk['p_id'] != $data['p_id'] || $this->pk['f_id'] != $data['f_id'])) {
alert('已存在相同資料');
}
}