本文整理汇总了PHP中confirm_query函数的典型用法代码示例。如果您正苦于以下问题:PHP confirm_query函数的具体用法?PHP confirm_query怎么用?PHP confirm_query使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了confirm_query函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: insertUser
function insertUser($uname, $email, $password)
{
global $connection;
$query = "INSERT INTO user (uname, email, password) VALUES ";
$query .= "('{$uname}', '{$email}', '{$password}')";
echo $query;
$result = mysqli_query($connection, $query);
confirm_query($result);
if ($result) {
$_SESSION['login_user'] = $uname;
$query = "SELECT uid FROM user WHERE ";
$query .= "uname = '{$uname}'";
$result = mysqli_query($connection, $query);
$rows = mysqli_num_rows($result);
if ($rows == 1) {
while ($row = mysqli_fetch_assoc($result)) {
$_SESSION['login_user_uid'] = $row["uid"];
}
}
header("location: editProfile.php");
} else {
$error = "Username already exists";
}
if (!$connection) {
mysql_close($connection);
}
echo "end";
}
示例2: execute_and_confirm
function execute_and_confirm($statement)
{
global $connection;
$result = mysqli_query($connection, $statement);
confirm_query($result);
return $result;
}
示例3: getUser
function getUser($uname)
{
global $connection, $email, $password, $interests, $rec;
$query = "SELECT uname, email, password, interests, recommendation_factor, tag_cloud FROM user ";
$query .= "WHERE user.uname = '{$uname}'";
//echo $query;
$result = mysqli_query($connection, $query);
confirm_query($result);
$rows = mysqli_num_rows($result);
if ($rows == 1) {
while ($row = mysqli_fetch_assoc($result)) {
$email = $row["email"];
$password = $row["password"];
$i = $row["interests"];
if ($i != null) {
$interests = explode(",", $i);
}
$recommendation_factor = $row["recommendation_factor"];
if ($recommendation_factor != null) {
$rec = explode(",", $recommendation_factor);
}
$tag_cloud = $row["tag_cloud"];
}
}
}
示例4: check
function check($idno, $scontact, $semail)
{
$sql = 'SELECT instruc_id, instruct_contact, email_add FROM instructor';
$result = mysql_query($sql);
confirm_query($result);
while ($row = mysql_fetch_array($result)) {
if ($idno == $row['instruc_id']) {
?>
<script type="text/javascript">
alert("ID already Exist!");
window.location("add_instructor.php");
</script>
<?php
} else {
if ($scontact == $row['instruct_contact']) {
?>
<script type="text/javascript">
alert("Contact already Exist!");
window.location("add_instructor.php");
</script>
<?php
} else {
if ($semail == $row['email_add']) {
?>
<script type="text/javascript">
alert("Email already Exist!");
window.location("add_instructor.php");
</script>
<?php
}
}
}
}
return true;
}
示例5: client_set
function client_set()
{
$query = "SELECT *\r\n\t\t\t FROM clients\r\n\t\t\t ORDER BY position ASC";
$clients = mysql_query($query);
confirm_query($clients);
return $clients;
}
示例6: showInterests
function showInterests($user)
{
global $connection;
$query = "SELECT interests FROM user ";
$query .= "WHERE user.uname = '{$user}'";
//echo $query;
$result = mysqli_query($connection, $query);
while ($row = mysqli_fetch_assoc($result)) {
$csv_interests = $row["interests"];
if ($csv_interests != null) {
$interests = explode(",", $csv_interests);
foreach ($interests as $interest_id) {
$query = "SELECT c_name FROM category ";
$query .= "WHERE category.cid = {$interest_id}";
//echo $query;
$result = mysqli_query($connection, $query);
confirm_query($result);
while ($row = mysqli_fetch_assoc($result)) {
echo "<a href=\"catergory.php?id=" . $interest_id . "\" class=\"btn btn-info\" role=\"button\"><strong>" . $row["c_name"] . "</strong></a> ";
}
}
} else {
echo $user . " has no selected interests";
}
}
if (!$connection) {
mysql_close($connection);
}
//echo "end";
}
示例7: db_delete
function db_delete($table, $column_name, $column_value)
{
$query = "DELETE FROM {$table} ";
$query .= "WHERE {$column_name} = {$column_value}";
$db_delete = mysqli_query($db, $query);
confirm_query($db_delete);
}
示例8: get_all_jumpers
function get_all_jumpers()
{
global $connection;
$query = "SELECT * FROM jumperdr";
$page_set = mysqli_query($connection, $query);
confirm_query($subject_set);
return $subject_set;
}
示例9: get_all_categories
function get_all_categories()
{
global $connection;
$query = "SELECT * FROM categories ";
$category_set = mysqli_query($connection, $query);
confirm_query($category_set);
return $category_set;
}
示例10: addType
function addType($type_name, $cat)
{
global $dbc;
$query = "INSERT INTO tbltypes (type_name, cat_id) " . "VALUES ('{$type_name}', {$cat})";
$result = mysqli_query($dbc, $query);
confirm_query($result, $query);
return $result;
}
示例11: find_pages_for_subject
function find_pages_for_subject($subject_id)
{
global $connection;
$query = "select * from pages where subject_id = {$subject_id}";
$page_set = mysqli_query($connection, $query);
confirm_query($page_set);
return $page_set;
}
示例12: del_gall
function del_gall($gallid)
{
global $connection;
$query = "SELECT * FROM `galleries` WHERE `id` = " . $gallid;
$result = mysqli_query($connection, $query);
$gall = mysqli_fetch_array($result);
// Specify the target directory and add forward slash
$dir = "../galleries/" . $gall['name'] . "/gallery/";
foreach (scandir($dir) as $item) {
if ($item == '.' || $item == '..') {
continue;
}
unlink($dir . DIRECTORY_SEPARATOR . $item);
}
rmdir($dir);
$dir = "../galleries/" . $gall['name'] . "/gallery-thumbs/";
foreach (scandir($dir) as $item) {
if ($item == '.' || $item == '..') {
continue;
}
unlink($dir . DIRECTORY_SEPARATOR . $item);
}
rmdir($dir);
$dir = "../galleries/" . $gall['name'] . "/";
rmdir($dir);
$query = "DELETE FROM `galleries` WHERE `id` = {$gallid}";
$result = mysqli_query($connection, $query);
confirm_query($result);
$pagegallquery = "SELECT * FROM `pages`";
$pagegallresult = mysqli_query($connection, $pagegallquery);
while ($page = mysqli_fetch_array($pagegallresult)) {
if (is_array(unserialize($page['galleries']))) {
$pagegalleries = unserialize($page['galleries']);
$index = array_search($gallid, $pagegalleries);
if ($index != false) {
unset($pagegalleries[$index]);
}
$pagegalleries = serialize($pagegalleries);
$query = "UPDATE `pages` SET `galleries`='{$pagegalleries}' WHERE id = {$page['id']}";
$result = mysqli_query($connection, $query);
}
}
$subgallquery = "SELECT * FROM `galleries`";
$subgallresult = mysqli_query($connection, $subgallquery);
while ($subgallery = mysqli_fetch_array($subgallresult)) {
if (is_array(unserialize($subgallery['subgalleries']))) {
$subgalleries = unserialize($subgallery['subgalleries']);
$index = array_search($gallid, $subgalleries);
if ($index != false) {
unset($subgalleries[$index]);
}
$subgalleries = serialize($subgalleries);
$query = "UPDATE `pages` SET `galleries`='{$subgalleries}' WHERE id = {$subgallery['id']}";
$result = mysqli_query($connection, $query);
}
}
$success = "Gallery was deleted!";
}
示例13: find_user_by_username
function find_user_by_username($username)
{
global $db;
$safe_username = $db->quote($username);
$info = $db->query("SELECT * FROM members WHERE username = {$safe_username} ");
$info = $info->fetchAll(PDO::FETCH_ASSOC);
confirm_query($info);
return $info;
}
示例14: page_general_query
function page_general_query($lang, $page)
{
global $connection;
$lang = get_lang($lang);
$query = "SELECT * \n\t\t\t\tFROM pages \n\t\t\t\tWHERE '{$page}' = subject_id AND lang = '{$lang}'";
$response = mysqli_query($connection, $query);
confirm_query($response);
return $response;
}
示例15: getUserById
function getUserById($username, $password)
{
$connection = connect();
$query = "SELECT * from user where user_name = '{$username}' and password = '{$password}' limit 1";
$result = mysqli_query($connection, $query);
confirm_query($result);
$user = mysqli_fetch_assoc($result);
return $user;
}