本文整理匯總了PHP中DB_Functions::isWardExisted方法的典型用法代碼示例。如果您正苦於以下問題:PHP DB_Functions::isWardExisted方法的具體用法?PHP DB_Functions::isWardExisted怎麽用?PHP DB_Functions::isWardExisted使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DB_Functions
的用法示例。
在下文中一共展示了DB_Functions::isWardExisted方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1:
<?php
include_once 'include/DB_Functions.php';
$db = new DB_Functions();
// json response array
//$response = array("error" => FALSE);
if (isset($_POST['ward_no']) && isset($_POST['ward_type'])) {
// receiving the post params
$Br_id = $_POST['branch_id'];
$Ward_No = $_POST['ward_no'];
$Ward_Type = $_POST['ward_type'];
// check if Ward already exists
if ($db->isWardExisted($Ward_No)) {
// Ward already exists
$response["response"] = 0;
$response["message"] = $Ward_No . " already exists";
echo json_encode($response);
} else {
// create a new user$Cust_Name, $Cust_Email, $Cust_Phone,$Cust_Address,$Cust_City,$Cust_State
//$user = $db->insertLaboratory($Br_ID, $Lab_Name);
$user = $db->insertWard($Br_id, $Ward_No, $Ward_Type);
if ($user) {
// Ward stored successfully
$response["response"] = 1;
$response["message"] = "Ward Details Inserted.";
echo json_encode($response);
} else {
// Ward failed to store
$response["response"] = 2;
$response["message"] = "Unknown error occurred in registration!";
echo json_encode($response);