当前位置: 首页>>代码示例>>PHP>>正文


PHP confirm_query函数代码示例

本文整理汇总了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";
}
开发者ID:GangaNitya,项目名称:VideoRecommender,代码行数:28,代码来源:insertUser.php

示例2: execute_and_confirm

function execute_and_confirm($statement)
{
    global $connection;
    $result = mysqli_query($connection, $statement);
    confirm_query($result);
    return $result;
}
开发者ID:rodneywells01,项目名称:RodneyBlog,代码行数:7,代码来源:sqlcommands.php

示例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"];
        }
    }
}
开发者ID:GangaNitya,项目名称:VideoRecommender,代码行数:25,代码来源:editProfile.php

示例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;
}
开发者ID:Junaid-Farid,项目名称:studinfo,代码行数:35,代码来源:check_instructor.php

示例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;
}
开发者ID:kaushalgairola,项目名称:time_table_genereation,代码行数:7,代码来源:functions.php

示例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> &nbsp;&nbsp;&nbsp;";
                }
            }
        } else {
            echo $user . " has no selected interests";
        }
    }
    if (!$connection) {
        mysql_close($connection);
    }
    //echo "end";
}
开发者ID:GangaNitya,项目名称:VideoRecommender,代码行数:30,代码来源:showInterests.php

示例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);
}
开发者ID:Ryick,项目名称:playground.com,代码行数:7,代码来源:db_connection.php

示例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;
}
开发者ID:ashk43712,项目名称:Jumper,代码行数:8,代码来源:functions.php

示例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;
}
开发者ID:0xCA2,项目名称:Hotline-To-Hell-Girl,代码行数:8,代码来源:fix_categories.php

示例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;
}
开发者ID:BeoSagittarius,项目名称:gamecenter,代码行数:8,代码来源:TypeController.php

示例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;
}
开发者ID:ravitejachebrolu,项目名称:CMS,代码行数:8,代码来源:functions.php

示例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!";
 }
开发者ID:johnsondelbert1,项目名称:prj-illuminate,代码行数:58,代码来源:gallery-list.php

示例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;
}
开发者ID:LeeDavid87,项目名称:CS-313,代码行数:9,代码来源:functions.php

示例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;
}
开发者ID:raffe90,项目名称:fundaseth,代码行数:9,代码来源:functions.php

示例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;
 }
开发者ID:CharuniKaushalya,项目名称:Database-Project,代码行数:9,代码来源:userConnection.php


注:本文中的confirm_query函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。