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