本文整理汇总了PHP中DatabaseFactory::passinggreen_master_db方法的典型用法代码示例。如果您正苦于以下问题:PHP DatabaseFactory::passinggreen_master_db方法的具体用法?PHP DatabaseFactory::passinggreen_master_db怎么用?PHP DatabaseFactory::passinggreen_master_db使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DatabaseFactory
的用法示例。
在下文中一共展示了DatabaseFactory::passinggreen_master_db方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: lookup_member
public static function lookup_member($id = null, $email = null)
{
$id = (int) $id;
$email = trim($email);
$sql = "SELECT `AutoID` , `useremail`, `userFirstname`, `userLastname` FROM `user_signup`";
if ($id || $email || $author) {
$sql .= " WHERE";
} else {
return null;
}
if ($id) {
$sql .= " `AutoID` = '{$id}'";
if ($email || $author) {
$sql .= " &&";
}
}
if ($email) {
$sql .= " `useremail` = '{$email}'";
}
if ($res = DatabaseFactory::passinggreen_master_db()->query($sql)) {
if ($res->num_rows == 1) {
$member = $res->fetch_object();
return new Member($member->AutoID);
} else {
return null;
}
}
return null;
}
示例2: findCryptKeyByUserID
public static function findCryptKeyByUserID($id)
{
$id = (int) $id;
$sql = "SELECT `UserID` FROM `keys`";
if ($id) {
$sql .= " WHERE";
} else {
return null;
}
if ($id) {
$sql .= " `UserID` = '{$id}'";
}
if ($res = DatabaseFactory::passinggreen_master_db()->query($sql)) {
if ($res->num_rows == 1) {
$crypt_key = $res->fetch_object();
return new self($crypt_key->UserID);
} else {
return null;
}
}
return null;
}
示例3: master_db
protected function master_db()
{
return DatabaseFactory::passinggreen_master_db();
}