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


PHP DBConnection::queryDB方法代码示例

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


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

示例1: Error

 function __construct($userID, DBConnection $DBConnection)
 {
     $query = "Select * FROM users WHERE id={$userID}";
     $results = $DBConnection->queryDB($query);
     if ($this->getDBConnection()->getDBConnection()->errno) {
         trigger_error('Mysql Error (' . $this->getDBConnection()->getDBConnection()->errno . '): ' . $this->getDBConnection()->getDBConnection()->error);
     } else {
         if (is_resource($results)) {
             $row = $results->fetch_assoc();
             $this->userID = $row["id"];
             $this->userName = $row["user_id"];
             $this->password = $row["user_password"];
         } else {
             trigger_error('No Valid Resource For UserID: ' . $userID);
         }
     }
     //$this->accounts = json_decode ( '{"youtube":{"user":"cqytvideouploader11","password":"Youtube11"},"metacafe":{"user":"youtube11@chrisqueen.com","password":"Youtube11"},"viddler":{"user":"cdqytuploader11","password":"Youtube11"},"yahoo":{"user":"cdqytuploader","password":"Youtube11"}}', true );
     //var_dump ( $this->accounts );
 }
开发者ID:laiello,项目名称:we-promote-this,代码行数:19,代码来源:UserAccount.php

示例2: ConfigParser

<?php

require_once 'ConfigParser.php';
require_once 'DBConnection.php';
new ConfigParser();
// Get the configuation details and store them as environment variables
if (isset($_REQUEST['userName']) && isset($_REQUEST['password'])) {
    $DBConnection = new DBConnection(mysqlServerIP2, dbname, dbuser, dbpassword);
    // Check to see if userName Already exist
    $results = $DBConnection->queryDB("Select id from users Where username='" . $_REQUEST['userName'] . "'");
    if ($results->num_rows > 0) {
        // Username already exists
        echo "Username already exists";
    } else {
        $DBConnection->queryDB("Insert into users (username,password) VALUES ('" . $_REQUEST['userName'] . "','" . $_REQUEST['password'] . "')");
        if ($DBConnection->getDBConnection()->errno) {
            echo "Error creating account for user";
        } else {
            echo "success";
        }
    }
} else {
    echo "usernam and password required";
}
开发者ID:laiello,项目名称:we-promote-this,代码行数:24,代码来源:UserAccountCreate.php

示例3: ConfigParser

<?php

require_once 'ConfigParser.php';
require_once 'DBConnection.php';
require_once 'UserAccount.php';
new ConfigParser();
// Get the configuation details and store them as environment variables
if (isset($_REQUEST['userName']) && isset($_REQUEST['password'])) {
    $DBConnection = new DBConnection(mysqlServerIP2, dbname, dbuser, dbpassword);
    $results = $DBConnection->queryDB("Select id from users Where username='" . $_REQUEST['userName'] . "' AND password='" . $_REQUEST['password'] . "'");
    $row = $results->fetch_assoc();
    $userID = $row["id"];
    $userAccount = new UserAccount($userID, $DBConnection);
    $results = $DBConnection->queryDB("Select location from uploadsites order by location");
    while ($row = $results->fetch_assoc()) {
        $accountName = $row['location'];
        if (isset($_REQUEST[$accountName . '-userName'])) {
            $accountUserName = $_REQUEST[$accountName . '-userName'];
            $accountPassword = $_REQUEST[$accountName . '-password'];
        } else {
            $alteredAccountName = str_replace(".", "_", $accountName);
            //echo("Altered Account: $alteredAccountName\n");
            $accountUserName = $_REQUEST[$alteredAccountName . '-userName'];
            $accountPassword = $_REQUEST[$alteredAccountName . '-password'];
        }
        //echo ("Updating $accountName with Username: " . $accountUserName . " Password: " . $accountPassword . "\n");
        $userAccount->updateAccount($accountName, $accountUserName, $accountPassword);
    }
    $success = $userAccount->saveAccounts();
    if ($success) {
        echo "Info Has Been Saved";
开发者ID:laiello,项目名称:we-promote-this,代码行数:31,代码来源:UserAccountUpdate.php


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