本文整理汇总了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');
}
示例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 {