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


PHP database::get_field_from_table方法代码示例

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


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

示例1: database

<?php

/**
 * Created by PhpStorm.
 * User: wq
 * Date: 12/6/15
 * Time: 1:46 AM
 */
require_once '../database.php';
$email = $_POST['user_email'];
$username = $_POST['user_name'];
$tel = $_POST['user_tel'];
$card = $_POST['user_card'];
$password = $_POST['user_password'];
$succeed = true;
if ($succeed) {
    $db = new database();
    $db->connect_to_db();
    //insert
    $user_re = $db->get_field_from_table('users', 'id', 'id_card', $card);
    if (count($user_re) == 0) {
        $values = array('email' => $email, 'name' => $username, 'tel' => $tel, 'id_card' => $card, 'password' => $password);
        $db->insert_data_into_table('users', $values);
        echo "你的用户";
        echo $username;
        echo "已成功注册!";
    } else {
        echo "注册失败!";
    }
}
开发者ID:shortybug,项目名称:Hospital,代码行数:30,代码来源:register.php

示例2: database

<?php

/**
 * Created by PhpStorm.
 * User: whx
 * Date: 2015/12/9
 * Time: 20:25
 */
require_once "../database.php";
$conn = new database();
$username = $_SESSION['username'];
$array = array("name" => $username);
$result = $conn->get_field_from_table("users", "id", $array);
echo $result[0]['id'];
开发者ID:shortybug,项目名称:Hospital,代码行数:14,代码来源:getuserinfo.php

示例3: database

/**
 * Created by PhpStorm.
 * User: whx
 * Date: 2015/12/5
 * Time: 10:40
 */
require_once "../database.php";
$province = $_GET['province'];
$city = $_GET['city'];
$hospital = $_GET['hospital'];
//$keshi = $_GET['keshi'];
$conn = new database();
if ($province != null && strcmp($province, "") != 0) {
    $keys = array("province" => $province);
    $result = $conn->get_field_from_table("city", "name", $keys);
    echo json_encode($result);
}
if ($city != null && strcmp($city, "") != 0) {
    $keys = array('name' => $city);
    $city_id = $conn->get_field_from_table("city", "id", $keys);
    $city_id_s = $city_id[0]['id'];
    $keys1 = array('city' => $city_id_s);
    $result = $conn->get_field_from_table("hospital", "name", $keys1);
    echo json_encode($result);
}
if ($hospital != null && strcmp($hospital, "") != 0) {
    $keys = array('name' => $hospital);
    $hospital_id = $conn->get_field_from_table("hospital", "id", $keys);
    $hospital_id_s = $hospital_id[0]['id'];
    $keys1 = array('hospital_id' => $hospital_id_s);
开发者ID:shortybug,项目名称:Hospital,代码行数:30,代码来源:quickorder.php

示例4: database

    echo $html_error_a . "医院详细地址" . $html_error_b;
    $succeed = false;
}
if (strlen($htel) < 1) {
    echo $html_error_a . "医院联系方式" . $html_error_b;
    $succeed = false;
}
if (strlen($hintr) < 1) {
    echo $html_error_a . "医院介绍" . $html_error_b;
    $succeed = false;
}
if ($succeed) {
    $db = new database();
    //search city
    $city_id = 0;
    $city_re = $db->get_field_from_table('city', 'id', 'name', $hcity);
    if (count($city_re) == 0) {
        $valuesci = array('name' => $hcity);
        $db->insert_data_into_table('city', $valuesci);
        $city_re = $db->get_field_from_table('city', 'id', 'name', $hcity);
    }
    $city_id = $city_re[0]['id'];
    //search grade
    $grade_id = 0;
    $grade_re = $db->get_field_from_table('grade', 'id', 'detail', $hgrade);
    if (count($grade_re) == 0) {
        $valuesci = array('detail' => $hgrade);
        $db->insert_data_into_table('grade', $valuesci);
        $grade_re = $db->get_field_from_table('grade', 'id', 'detail', $hgrade);
    }
    $grade_id = $grade_re[0]['id'];
开发者ID:shortybug,项目名称:Hospital,代码行数:31,代码来源:editHospital.php

示例5: database

<?php 
//登录
require_once '../database.php';
$username = $_POST['username'];
$password = $_POST['password'];
$errmsg = '';
if (!empty($errmsg)) {
    if (empty($username)) {
        $errmsg = "数据输入不完整";
    }
}
if (empty($errmsg)) {
    $db = new database();
    $db->connect_to_db();
    if (mysqli_connect_errno()) {
        $errmsg = "shu ju ku lian jie shi bai!<br>\n";
    } else {
        $realusername = $db->get_field_from_table('users', 'name', 'id_card');
        $realpassword = $db->get_field_from_table('users', 'password', 'id_card');
        if ($username == $realusername && $password == $realpassword) {
            $errmsg = "deng lu cheng gong";
            session_start();
            $_SESSION['uid'] = $username;
            if (empty($_SESSION['uid'])) {
                echo "你还没有登录";
            }
        } else {
            $errmsg = "deng lu shi bai!";
        }
    }
}
开发者ID:shortybug,项目名称:Hospital,代码行数:31,代码来源:login.php

示例6: database

    echo $html_error_a . "缺少科室名称" . $html_error_b;
    $succeed = false;
}
if (strlen($hbelong) < 1) {
    echo $html_error_a . "缺少科室所属医院" . $html_error_b;
    $succeed = false;
}
if (strlen($hintr) < 1) {
    echo $html_error_a . "缺少科室介绍" . $html_error_b;
    $succeed = false;
}
if ($succeed) {
    $db = new database();
    //search hospital
    $hospital_id = 0;
    $hos_re = $db->get_field_from_table('hospital', 'id', 'name', $hbelong);
    if (count($hos_re) == 0) {
        echo $html_error_a . "未在数据库中发现所属医院信息(请确认信息正确或先添加所属医院信息)" . $html_error_b;
        echo $html_error_return;
    } else {
        $hospital_id = $hos_re[0]['id'];
        $values = array('name' => $hname, 'hospital_id' => $hospital_id, 'intro' => $hintr);
        $db->insert_data_into_table('department', $values);
        echo $html_successa . $hname . "添加成功!" . $html_successb;
    }
} else {
    echo $html_error_return;
}
?>
 
		</body>
开发者ID:shortybug,项目名称:Hospital,代码行数:31,代码来源:editOffice.php

示例7: database

    echo $html_error_a . "缺少所属医院" . $html_error_b;
    $succeed = false;
}
if (strlen($office) < 1) {
    echo $html_error_a . "缺少所属科室" . $html_error_b;
    $succeed = false;
}
if (strlen($hintr) < 1) {
    echo $html_error_a . "缺少医生介绍" . $html_error_b;
    $succeed = false;
}
if ($succeed) {
    $db = new database();
    //search grade
    $grade_id = 0;
    $grade_re = $db->get_field_from_table('grade', 'id', 'detail', $hlevel);
    if (count($grade_re) == 0) {
        $valuesci = array('detail' => $hlevel);
        $db->insert_data_into_table('grade', $valuesci);
        $grade_re = $db->get_field_from_table('grade', 'id', 'detail', $hlevel);
    }
    $grade_id = $grade_re[0]['id'];
    //search major
    $major_id = 0;
    $major_re = $db->get_field_from_table('major', 'id', 'name', $hmajor);
    if (count($major_re) == 0) {
        $valuesci = array('name' => $hmajor);
        $db->insert_data_into_table('major', $valuesci);
        $major_re = $db->get_field_from_table('major', 'id', 'name', $hmajor);
    }
    $major_id = $major_re[0]['id'];
开发者ID:shortybug,项目名称:Hospital,代码行数:31,代码来源:editDoctor.php

示例8: json_encode

<?php

/**
 * Created by PhpStorm.
 * User: whx
 * Date: 2015/12/8
 * Time: 23:36
 */
require_once "../database.php";
$conn = new database();
$hospital = $_GET['hospital'];
//"北京大学第三医院";
$department = $_GET['department'];
//"骨科";
$keys = array('name' => $hospital);
$hospital_id = $conn->get_field_from_table("hospital", "id", $keys);
$hospital_id_s = $hospital_id[0]['id'];
$keys1 = array('name' => $department);
$department_id = $conn->get_field_from_table("department", "id", $keys1);
$department_id_s = $department_id[0]['id'];
$keys2 = array('hospital_id' => $hospital_id_s, 'department_id' => $department_id_s);
$doctor = $conn->get_field_from_table("doctor", "*", $keys2);
echo json_encode($doctor);
//echo $doctor[0]['name'];
开发者ID:shortybug,项目名称:Hospital,代码行数:24,代码来源:search_doctor.php

示例9: database

<?php

header("Content-type: text/html; charset=utf-8");
require_once 'database.php';
$db = new database();
$values = array('name' => "GuanFuHe", 'password' => "123456");
$db->insert_data_into_table('users', $values);
$key_values = array('province' => '北京市');
print_r($key_values);
$results = $db->get_field_from_table('city', '*', $key_values);
print_r($results);
开发者ID:shortybug,项目名称:Hospital,代码行数:11,代码来源:example_for_database.php


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