當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DBConnector::executeQuery方法代碼示例

本文整理匯總了PHP中DBConnector::executeQuery方法的典型用法代碼示例。如果您正苦於以下問題:PHP DBConnector::executeQuery方法的具體用法?PHP DBConnector::executeQuery怎麽用?PHP DBConnector::executeQuery使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DBConnector的用法示例。


在下文中一共展示了DBConnector::executeQuery方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

<?php

include 'DBConnector.php';
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 * Description of SignUpController
 *
 * @author mengchaowang
 */
if (isset($_POST['submit'])) {
    $params = array($_POST["name"], $_POST["ID"], $_POST["password"], $_POST["phone"], $_POST["email"], $_POST["address"]);
    // We need to find a way to hash the password instead of storing plaintext
    $query = 'INSERT INTO patient(patient_id, patient_name, phone_number, e_mail, address, patient_password) ' . 'VALUES($1, $2, $3, $4, $5, $6);';
    $result = DBConnector::executeQuery($query, $params);
    //var_dump($result);
    if (!$result) {
        echo "FALSE";
    }
    header('Location: /SmartCapWeb-V2.0/View/login.php');
}
開發者ID:ririkax,項目名稱:adherence-web-cloud-code,代碼行數:24,代碼來源:SignUpController.php

示例2: switch

switch ($accountType) {
    case "Patient":
        $sql_password = 'SELECT patient_password from patient where patient_id = $1';
        //echo $curPassword;
        break;
    case "Doctor":
        $sql_password = 'SELECT doctor_password from octor where doctor_id = $1';
        break;
    case "Phamercy":
        break;
        /**/
    /**/
    default:
        return FALSE;
}
$query_result = DBConnector::executeQuery($sql_password, $sql_password_parameter);
if (!$query_result) {
    echo pg_last_error();
    return FALSE;
}
$password_row = pg_fetch_row($query_result, 0);
$curPassword = $password_row[0];
if ($curPassword == null) {
    echo "No password found";
    return FALSE;
}
//var_dump($password_query);
if ($curPassword == $password) {
    echo "valid";
    return "valid";
} else {
開發者ID:ririkax,項目名稱:adherence-web-cloud-code,代碼行數:31,代碼來源:LoginController.php


注:本文中的DBConnector::executeQuery方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。