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


PHP DB_CONNECT::fetch_array方法代码示例

本文整理汇总了PHP中DB_CONNECT::fetch_array方法的典型用法代码示例。如果您正苦于以下问题:PHP DB_CONNECT::fetch_array方法的具体用法?PHP DB_CONNECT::fetch_array怎么用?PHP DB_CONNECT::fetch_array使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DB_CONNECT的用法示例。


在下文中一共展示了DB_CONNECT::fetch_array方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: substr

     // convert the number
     $original_number = $number["phonenumber"];
     if ($original_number[0] == '0') {
         $number = substr($original_number, 1);
         $original_number = "+91" . $number;
     } else {
         if ($original_number[0] == '+') {
             // do nothing every thing is fine
         } else {
             $original_number = "+91" . $original_number;
         }
     }
     $query_string = "SELECT * FROM login WHERE id = '{$original_number}'";
     $result = $db->query_db($query_string);
     if ($db->number_of_rows($result) > 0) {
         $row = $db->fetch_array($result);
         // If number["phonenumber"] is found in the login table...
         // Check if it is already added or not...
         $query_string2 = "SELECT * FROM family WHERE family_id = '{$original_number}'\n\t\t\t\t\t\t\t\t  && member_id = '{$id}'";
         $result2 = $db->query_db($query_string2);
         if ($db->number_of_rows($result2) > 0) {
         } else {
             $query_string3 = "INSERT INTO family(member_id,family_id) VALUES('{$id}','{$original_number}')";
             $result3 = $db->query_db($query_string3);
         }
     }
 }
 $queryString = "SELECT * FROM family,login WHERE member_id = '{$id}' && id = family_id";
 $result = $db->query_db($queryString);
 $addednumbers = array();
 if ($db->number_of_rows($result) > 0) {
开发者ID:navneet1v,项目名称:Disaster-Safety,代码行数:31,代码来源:contact.php

示例2: while

require_once '../includes/db_connect.php';
require_once '../includes/functions.php';
require_once '../includes/session.php';
confirm_logged_in();
$db = new DB_CONNECT();
// get username from the session
$username = get_username();
//select all test created by him from test table
if (isset($_GET["message"])) {
    $message = "The Test has been deleted.";
}
$query = "SELECT test_name,start_time,end_time,event_date,duration FROM test WHERE username='{$username}'";
$admin_tests = $db->query_database($query);
if ($db->number_of_rows($admin_tests) > 0) {
    $i = 1;
    while ($row = $db->fetch_array($admin_tests)) {
        $table_data = array();
        $table_data_array[$i] = array();
        $table_data["test_name"] = $row["test_name"];
        $table_data["start_time"] = $row["start_time"];
        $table_data["end_time"] = $row["end_time"];
        $table_data["event_date"] = $row["event_date"];
        $table_data["duration"] = $row["duration"];
        $table_data_array[$i] = $table_data;
        $i++;
    }
    $no_of_rows = $i - 1;
    $table_data_array["number_of_rows"] = $no_of_rows;
    $table_html = make_test_information_table();
} else {
    //echo " No tables created by admin";
开发者ID:abhik-setia,项目名称:MCQTECHNO,代码行数:31,代码来源:view_test.php

示例3: array

<?php

require_once "includes/db_connect.php";
require_once "includes/functions.php";
$response = array();
$db = new DB_CONNECT();
if (isset($_POST["id"]) && isset($_POST["phonenumber"])) {
    $id = $_POST["id"];
    $number = $_POST["phonenumber"];
    $query = "SELECT * FROM family WHERE member_id = '{$number}' && family_id = '{$id}'";
    $result = $db->query_db($query);
    if ($db->number_of_rows($result) > 0) {
        $row = $db->fetch_array($result);
        $permission = $row["permission_given"];
        if ($permission == 1) {
            // now get the position of the specified user
            $query1 = "SELECT * FROM login where id = '{$number}'";
            $result1 = $db->query_db($query1);
            if ($db->number_of_rows($result1) > 0) {
                $row = $db->fetch_array($result1);
                $response["success"] = 1;
                $response["latitude"] = $row["latitude"];
                $response["longitude"] = $row["longitude"];
                $response["message"] = "You can access his location";
            }
        } else {
            // permission is 0
            $response["success"] = 0;
            $response["message"] = "The user has not provied the accces to its location";
        }
    } else {
开发者ID:navneet1v,项目名称:Disaster-Safety,代码行数:31,代码来源:check_permission.php

示例4: array

            } else {
                redirect_to("question_list.php?test_name=" . get_test_name());
            }
        } else {
            echo "empty fields";
        }
    } else {
        echo "Someting was not set";
    }
} else {
    $db = new DB_CONNECT();
    $query = "SELECT * FROM test WHERE test_name='" . get_test_name() . "' AND username='" . get_username() . "' ";
    $details = $db->query_database($query);
    if ($db->number_of_rows($details) > 0) {
        $i = 1;
        $row = $db->fetch_array($details);
        $table_data = array();
        $table_data["test_name"] = $row["test_name"];
        $table_data["start_time"] = $row["start_time"];
        $table_data["end_time"] = $row["end_time"];
        $table_data["event_date"] = $row["event_date"];
        $table_data["duration"] = $row["duration"];
    }
}
?>

<!DOCTYPE html>
<html>
   <head>
      <title> Test Details</title>
      <meta charset="UTF-8">
开发者ID:abhik-setia,项目名称:MCQTECHNO,代码行数:31,代码来源:edit_test_details.php

示例5: urldecode

<?php

require_once '../includes/db_connect.php';
require_once '../includes/functions.php';
require_once '../includes/session.php';
confirm_logged_in();
$db = new DB_CONNECT();
// get username from the session
$username = get_username();
$test_name = urldecode($_GET['test_name']);
//select all test created by him from test table
$query = "SELECT * FROM " . $test_name . "_users";
$users_table = $db->query_database($query);
if ($db->number_of_rows($users_table) > 0) {
    $i = 1;
    while ($row = $db->fetch_array($users_table)) {
        $table_data = array();
        $table_data_array[$i] = array();
        $table_data["first_name"] = $row["first_name"];
        $table_data["last_name"] = $row["last_name"];
        $table_data["email"] = $row["email"];
        $table_data["phone_number"] = $row["phone_number"];
        $table_data["score"] = $row["score"];
        $table_data["questions_attempted"] = $row["questions_attempted"];
        $table_data["correct_ans"] = $row["correct_ans"];
        $table_data["wrong_ans"] = $row["wrong_ans"];
        $table_data_array[$i] = $table_data;
        $i++;
    }
    $no_of_rows = $i - 1;
    $table_data_array["number_of_rows"] = $no_of_rows;
开发者ID:abhik-setia,项目名称:MCQTECHNO,代码行数:31,代码来源:view_users_of_table.php


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