本文整理匯總了PHP中DB_Functions::insertUser方法的典型用法代碼示例。如果您正苦於以下問題:PHP DB_Functions::insertUser方法的具體用法?PHP DB_Functions::insertUser怎麽用?PHP DB_Functions::insertUser使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DB_Functions
的用法示例。
在下文中一共展示了DB_Functions::insertUser方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1:
<?php
include_once './db_functions.php';
//Create Object for DB_Functions clas
$db = new DB_Functions();
$emailID = $_POST["name"];
$regId = $_POST["regId"];
$res = $db->insertUser($emailID, $regId);
echo "Email Id " . $emailID . " RegId " . $regId;
if ($res) {
echo "GCM Reg Id bas been shared successfully with Server";
} else {
echo "Error occured while sharing GCM Reg Id with Server web app";
}
示例2: mysql_insert_id
<?php
include_once './db_functions.php';
//Create Object for DB_Functions clas
$db = new DB_Functions();
$emailID = $_POST["emailId"];
$passwordID = $_POST["passwordId"];
$nameID = $_POST["nameId"];
$regId = $_POST["regId"];
$type = "android";
$res = $db->insertUser($emailID, $passwordID, $nameID, $regId, $type);
echo mysql_insert_id();
/*
$emailID = "name@email.com";
$passwordID = "password";
$nameID = "Name McName";
$regId = "aBcd345";
$res = $db->insertUser($emailID, $passwordID, $nameID, $regId);
*/
// echo "Email Id ".$emailID." RegId ".$regId ;
// if ($res) {
// echo "GCM Reg Id bas been shared successfully with Server";
// } else {
// echo "Error occured while sharing GCM Reg Id with Server web app";
// }
示例3: header
</div>
<div class="form-group">
<div class="col-md-6 col-md-offset-4">
<button type="submit" class="btn btn-success">
Register
</button>
</div>
</div>
</form>
<?php
if (isset($_POST["Name"])) {
if (strtolower($_POST["Name"]) !== "admin") {
$result = $db->insertUser($_POST);
if (!$result) {
echo '<span style="color:red">Email or Name Already Registered<span>';
} else {
header("location: users.php");
}
} else {
echo '<span style="color:red">Name admin is not allowed<span>';
}
}
?>
</div>
</div>
</div>
</div>
</div>