本文整理汇总了PHP中SQL::Create方法的典型用法代码示例。如果您正苦于以下问题:PHP SQL::Create方法的具体用法?PHP SQL::Create怎么用?PHP SQL::Create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SQL
的用法示例。
在下文中一共展示了SQL::Create方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: OpenIDAddLogin
}
}
//print_r($_GET);
}
function OpenIDAddLogin($openIdentifier, $data)
{
$userlist = $openIdentifier;
$db = new SQL(0);
$w = array();
$w["username"] = $userlist;
$w["provider"] = "openid";
$w["user"] = MyUser::id();
$db->CreateUpdate(0, 'user_login', $w);
PageEngine::AddSuccessMessage("openid", "Zugriffsart hinzugefügt");
}
function OpenIDRegisterLogin($openIdentifier, $data)
{
$userlist = $openIdentifier;
$db = new SQL(0);
$row = $db->cmdrow(0, 'SELECT * FROM user_login WHERE username="{0}" AND provider="openid" LIMIT 0,1', array($userlist));
if (!isset($row["username"])) {
$db->cmd(0, 'INSERT IGNORE INTO user_list ');
$w = array();
if (isset($data["nickname"])) {
$w["username"] = $data["nickname"] . "#" . rand(0, 99999);
} else {
$w["username"] = "User#" . rand(0, 99999);
}
$w["email_standard"] = $data["email"];
if (isset($data["language"])) {
示例2: setbounty
public static function setbounty($data)
{
if (!MyUser::isloggedin()) {
throw new APIException("User ist nicht angemeldet.", 100);
}
$data["karma"] = floor(string2::vall($data["karma"] + 0));
$data["bitcoin"] = string2::vall($data["bitcoin"] + 0);
$data["EUR"] = string2::vall($data["EUR"] + 0);
$db = new SQL(0);
if ($data["karma"] > 0) {
if (MyUser::getKarmaPoints() < 75) {
throw new APIException("Du benötigst 75 Karma-Punkte um eine Karma Bounty zu geben.", 200);
}
if (MyUser::getKarmaPoints() < $data["karma"] + 0) {
throw new APIException("Du hast nur " . MyUser::getKarmaPoints() . " Karma Punkte zu verschenken!", 200);
}
$w = array();
$w["question"] = $data["question"] + 0;
$w["user"] = MyUser::id();
$w["amount"] = $data["karma"];
$w["currency"] = "kar";
$w["dt_created"] = time();
$db->Create(0, 'question_bounty', $w);
Karma::add(MyUser::id(), 5, 0 - $w["amount"], $w["question"]);
}
if ($data["bitcoin"] > 0) {
throw new APIException("Sie haben nicht genügend Bitcoin Guthaben.", 610);
}
if ($data["EUR"] > 0) {
throw new APIException("Sie haben nicht genügend Euro Guthaben.", 710);
}
}
示例3: implode
$w["tags"] = implode(",", tags2array($_POST["tags"]));
$w["date_created"] = time();
$w["date_edited"] = time();
$w["date_action"] = time();
$w["user_action"] = MyUser::id() + 0;
if (!MyUser::isloggedin()) {
$w["author"] = -1;
} elseif (isset($_POST["wiki"]) and $_POST["wiki"] == "1") {
$w["author"] = -2;
} elseif (isset($_POST["ask_anonymously"]) and $_POST["ask_anonymously"] == "1") {
$w["author"] = MyUser::id();
$w["is_anonymous"] = "1";
} else {
$w["author"] = MyUser::id();
}
$db->Create(0, 'questions', $w);
$frageid = $db->LastInsertKey();
if (!isset($_GET["tag"])) {
$_GET["tag"] = "";
}
$g = explode(",", $_GET["tag"] . "," . $_POST["tags"]);
foreach (tags2array($_POST["tags"]) as $a) {
if (trim($a) == "") {
continue;
}
$w3 = array();
$w3["question"] = $frageid;
$w3["tag"] = $a;
$db->CreateUpdate(0, "question_tags", $w3);
}
$_SESSION["myuser"]["lastwritten"]["question"][$frageid] = true;
示例4: while
$j = true;
if (Userlist::userexists($_POST["username"])) {
PageEngine::AddErrorMessage("register", "Der Username wird bereits verwendet");
$j = false;
}
if ($j) {
$passwort = "";
$alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz";
while (strlen($passwort) < 6) {
$passwort .= substr($alpha, rand(0, strlen($alpha)), 1);
}
$w = array();
$w["username"] = $_POST["username"];
$w["email_standard"] = strtolower($_POST["email"]);
$w["dt_registered"] = time();
$db->Create(0, "user_list", $w);
$userid = $db->LastInsertKey();
$w2 = array();
$w2["username"] = "user[" . $userid . "]";
$w2["pwd"] = md5($passwort);
$w2["provider"] = "local";
$w2["user"] = $userid;
$db->Create(0, "user_login", $w2);
$mail = new PHPMailer();
$mail->SetFrom('no-reply@' . $_SERVER["HTTP_HOST"], 'Registrierung ' . SiteConfig::val("page/title"));
$mail->AddAddress($_POST["email"], $w["username"]);
$local = PageEngine::html_find("email_register", ".tpl");
$body = file_get_contents($local);
$body = str_replace(array("{{password}}", "{{page_title}}"), array($passwort, SiteConfig::val("page/title", "Q/A Forum")), $body);
$mail->Subject = "Deine Registrierung bei " . SiteConfig::val("page/title");
$mail->AltBody = 'Vielen Dank für Deine Registrierung,