本文整理汇总了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>