本文整理汇总了PHP中getMysqli函数的典型用法代码示例。如果您正苦于以下问题:PHP getMysqli函数的具体用法?PHP getMysqli怎么用?PHP getMysqli使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getMysqli函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: insertKineVisit
function insertKineVisit($kine)
{
$mysqli = getMysqli();
$sql = "INSERT INTO kine_test(id_patient, date_kine, tinettiPoma, getupandgo, slow_walk, fast) VALUES(" . $kine['id_patient'] . ", " . $kine['date_kine'] . ", " . $kine['tinettiPoma'] . ", " . $kine['getupandgo'] . ", " . $kine['slow_walk'] . ", " . $kine['fast_walk'] . ");";
$result = $mysqli->query($sql);
return $result;
}
示例2: insertmedicalCheck
function insertmedicalCheck($mediVisit)
{
$mysqli = getMysqli();
$sql = "INSERT INTO medical_check(id_patient, date_visit, height, weight, bmi, albumin, crp, vitamin_d, frequency, pressure, gir) VALUES(" . $mediVisit['id_patient'] . ", " . $mediVisit['date_visit'] . ", " . $mediVisit['height'] . ", " . $mediVisit['weight'] . ", " . $mediVisit['bmi'] . ", " . $mediVisit['albumin'] . ", " . $mediVisit['crp'] . ", " . $mediVisit['vitamin_d'] . ", " . $mediVisit['frequency'] . ", " . $mediVisit['pressure'] . ", " . $mediVisit['gir'] . ");";
$result = $mysqli->query($sql);
return $result;
}
示例3: insertPsychoVisit
function insertPsychoVisit($psychoVisit)
{
$mysqli = getMysqli();
$sql = "INSERT INTO psychological_test VALUES(" . $psychoVisit['id_patient'] . ", " . $psychoVisit['date_psycho'] . ", " . $psychoVisit['minibesttest_score'] . ", " . $psychoVisit['greco_global'] . ", " . $psychoVisit['greco_immediat'] . ", " . $psychoVisit['greco_differe'] . ");";
$result = $mysqli->query($sql);
return $result;
}
示例4: getPatientPage
function getPatientPage($user)
{
$mysqli = getMysqli();
$sql = "SELECT * FROM user INNER JOIN patient_account ON 'user.id_user' = 'patient_account.id_user' WHERE 'user.id_user' = " . $user . ";";
$result = array();
$query = $mysqli->query($sql);
while ($row = $query->fetch_assoc()) {
array_push($result, $row);
}
return $result;
}
示例5: getUserByEmail
function getUserByEmail($email)
{
$mysqli = getMysqli();
$sql = "SELECT * FROM User WHERE Name = " . $email . ";";
$result = array();
$query = $mysqli->query($sql);
while ($row = $query->fetch_assoc()) {
array_push($result, $row);
}
return $result;
}
示例6: l_log
function l_log($pinkieID, $user, $msg, $lvl)
{
$_db = getMysqli();
$_sql = "INSERT INTO Log (PinkieID, User, Level, Message) VALUES (?,?,?,?)";
$_stmt = $_db->prepare((string) $_sql);
$_stmt->bind_param('isss', $pinkieID, $user, $lvl, $msg);
$_stmt->execute();
if ($_stmt->errno) {
onError("Error in Logger.php::log()", $_stmt->error);
}
$_stmt->close();
// Close up the database connection.
$_db->close();
}
示例7: is_allowed
function is_allowed($userId, $targetId)
{
$mysqli = getMysqli();
$sql = "SELECT * FROM patientToPro WHERE 'idPro' = " . $userId . " AND 'idPatient' = " . $targetId . ";";
$result = array();
$query = $mysqli->query($sql);
while ($row = $query->fetch_assoc()) {
array_push($result, $row);
}
if (sizeof($result) == 0) {
return false;
} else {
return true;
}
}
示例8: printAllVendors
function printAllVendors()
{
$_db = getMysqli();
$_stmt = $_db->prepare("SELECT VendorName, VendorID FROM Vendors");
$_stmt->execute();
$_stmt->bind_result($s_VendorName, $i_VendorID);
while ($_stmt->fetch()) {
$_value = "<tr>\n <td>\n " . $s_VendorName . "\n </td>\n <td>";
if (canEditVendors()) {
$_value = $_value . "<a href='./vendor.php?reason=edit&vid=" . $i_VendorID . "' class='btn btn-info' role='button'><span class='glyphicon glyphicon-pencil'></span> Update/Change</a> ";
}
$_value = $_value . "<a href='./vendor.php?reason=view&vid=" . $i_VendorID . "' class='btn btn-primary' role='button'><span class='glyphicon glyphicon-search'></span> View</a>";
$_value = $_value . "</td></tr>";
echo $_value;
}
$_stmt->free_result();
$_db->close();
}
示例9: isExist
function isExist($key, $value, &$errmsg)
{
if ($key == "email" || $key == "username") {
$q1 = "SELECT {$key} FROM userlist WHERE {$key} = '{$value}'";
$q2 = "SELECT {$key} FROM nonactivatedUser WHERE {$key} = '{$value}'";
$q = $q1 . " UNION " . $q2;
$mysqli = getMysqli();
if ($rs = $mysqli->query($q)) {
if ($rs->fetch_assoc()) {
return true;
}
} else {
$errmsg = "error";
trigger_error("Failed to {$q} caused by : \r\n\t" . $mysqli->error);
}
}
return false;
}
示例10: get
function get($uid, &$data, &$errmsg)
{
if (isX($uid, XUSERID)) {
if ($mysqli = getMysqli()) {
$q = "SELECT id, money, type, CONVERT(date, DATE) AS date FROM tallybook_bill WHERE userid = {$uid}";
if ($rs = $mysqli->query($q)) {
$data = json_encode(new RsValue($rs));
return true;
} else {
trigger_error("Failed to {$q} caused by : \r\n\t" . $mysqli->error);
$errmsg = "error";
}
} else {
trigger_error("Failed to connect to the database");
$errmsg = "error";
}
}
return false;
}
示例11: printSubmittedByYouTable
function printSubmittedByYouTable()
{
$_db = getMysqli();
$statement = $_db->prepare("SELECT * FROM Submitted_By WHERE Submitter=? && Status!=? && Status !=? && Status!=?");
$a = Archived;
$c = Cancelled;
$d = Done;
$statement->bind_param('ssss', $_SESSION['Username'], $a, $c, $d);
$statement->execute();
// Error running the statement.
if ($statement->errno != 0) {
$_tmp = $statement->error;
$statement->close();
$_db->close();
onError("Home::printSubmittedToYouTable()", 'There was an error running the query [' . $_tmp . '] Could not fetch Pinkies submitted to: ' . $_SESSION['Username']);
}
$statement->store_result();
if ($statement->num_rows <= 0) {
echo '<tr>
<td> No Pinkies submitted by you!</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>';
return;
}
// We have a result, lets bind the result to the variables.
$statement->bind_result($pinkieID, $timestamp, $submitterUser, $submittedFor, $title, $status, $totalvalue, $OriginalSubmitter, $SupervisorApprove, $AdminApprove, $TransProcess);
while ($statement->fetch()) {
printf('<tr>
<td>%s</td>
<td>%s</td>
<td>%s</td>
<td>%.2f</td>
<td><a href="./viewpinkie.php?pid=%d" class="btn btn-primary" role="button"><span class="glyphicon glyphicon-search"></span> View</a></td>
</tr>', $title, $submittedFor, $timestamp, $totalvalue, $pinkieID);
}
// Cleanup.
$statement->free_result();
$statement->close();
$_db->close();
}
示例12: InquryByID
function InquryByID($_id)
{
$mysqli = getMysqli();
$sql = "SELECT * FROM `Soccer` WHERE _index=?";
$stmt = $mysqli->prepare($sql);
$stmt->bind_param('i', $_id);
$stmt->execute();
$stmt->bind_result($index, $date, $content);
$dataArray = [];
$row = null;
while ($stmt->fetch()) {
$row = [];
$row['_index'] = $index;
$row['_date'] = $date;
$row['_content'] = html_entity_decode(htmlspecialchars($content));
array_push($dataArray, $row);
}
$stmt->close();
return json_encode($dataArray);
}
示例13: printAllFunds
function printAllFunds()
{
$_db = getMysqli();
if (canEditFunds()) {
$_stmt = $_db->prepare("SELECT FundName, FundID, Balance, Timestamp FROM Funds");
} else {
$_stmt = $_db->prepare("SELECT FundName, FundID, Balance, Timestamp FROM Funds WHERE Active=1");
}
$_stmt->execute();
$_stmt->bind_result($s_FundName, $i_FundID, $s_Balance, $s_Timestamp);
while ($_stmt->fetch()) {
$_value = "<tr>\n <td>" . $s_FundName . "</td>\n <td>" . $s_Balance . "</td>\n <td>" . $s_Timestamp . "</td>\n <td>";
if (canEditFunds()) {
$_value = $_value . "<a href='./fund.php?reason=edit&fid=" . $i_FundID . "' class='btn btn-info' role='button'><span class='glyphicon glyphicon-pencil'></span> Update/Change</a> ";
}
$_value = $_value . "<a href='./fund.php?reason=view&fid=" . $i_FundID . "' class='btn btn-primary' role='button'><span class='glyphicon glyphicon-search'></span> View</a>";
$_value = $_value . "</td></tr>";
echo $_value;
}
$_stmt->free_result();
$_db->close();
}
示例14: saveUser
function saveUser($user)
{
$mysqli = getMysqli();
$sql_common = "INSERT INTO user(email, password, gender, name, firstname, street, zip, city, phone, mobile, account) VALUES ('" . $user['email'] . "' ,'" . $user['pass'] . "' ,'" . $user['gender'] . "' ,'" . $user['name'] . "' ,'" . $user['firstname'] . "', '" . $user['street'] . "' ,'" . $user['zip'] . "' ,'" . $user['city'] . "' ,'" . $user['phone'] . "' ,'" . $user['mobile'] . "', '" . $user['isPro'] . "');";
$result = $mysqli->query($sql_common) or QueryError("Invalid query registering user", $sql_common, $mysqli->error);
$id = $mysqli->insert_id;
switch ($user['isPro']) {
case 0:
$sql_patient = "INSERT INTO patient_account VALUES ('" . $id . "', '" . $user['physicianName'] . "' ,'" . $user['physicianMail'] . "' ,'" . $user['birthday'] . "' ,'" . $user['emergency'] . "', '" . $user['status'] . "' ,'" . $user['accompaniment'] . "' ,'" . $user['residency'] . "' , '" . $user['isFinancial'] . "' ,'" . $user['isHelp'] . "');";
$resultPatient = $mysqli->query($sql_patient) or QueryError("Invalid query registering patient", $sql_patient, $mysqli->error);
return $result && $resultPatient;
break;
case 1:
$sql_pro = "INSERT INTO professional_account VALUES ('" . $id . "', '" . $user['officeName'] . "')";
$resultPro = $mysqli->query($sql_pro) or QueryError("Invalid query registering pro", $sql_pro, $mysqli->error);
return $result && $resultPro;
break;
default:
return false;
break;
}
}
示例15: extractResult
function extractResult($filterType, $param)
{
$arr = array();
$query = "select word_geo from words where word_eng " . $filterType . " ? ";
$mysqli = getMysqli();
$stmt = getStatementByQueryFromMysqli($query, $mysqli);
$param = Converter::ToLatin($param);
$stmt->bind_param("s", $param);
/* execute statement */
$stmt->execute();
// bind result variables
$stmt->bind_result($word_value);
$counter = 0;
//fetch values
while ($stmt->fetch()) {
if ($counter++ > 999) {
break;
}
array_push($arr, array('id' => $counter, 'value' => $word_value));
}
closeConnections($stmt, $mysqli);
return $arr;
}