本文整理汇总了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('已存在相同資料');
}
}