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


PHP DoQuery函数代码示例

本文整理汇总了PHP中DoQuery函数的典型用法代码示例。如果您正苦于以下问题:PHP DoQuery函数的具体用法?PHP DoQuery怎么用?PHP DoQuery使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: CheckLogin

function CheckLogin($connection, $level)
{
    // Check if all session variables are set
    sec_session_start();
    // specifically check our username and hashed password
    if (isset($_SESSION['username'], $_SESSION['secondpw'])) {
        $username = $_SESSION['username'];
        $secondpw = $_SESSION['secondpw'];
        $username = $connection->escape_string($username);
        //$secondpw = $connection->escape_string($secondpw);
        // Get the user-agent string of the user.
        //$user_browser = $_SERVER['HTTP_USER_AGENT'];
        $sql = "SELECT HashPassword,Salt from Users WHERE UserName = '" . $username . "' AND Confirmed = '1' AND Level >= '" . $level . "' AND idUsers > 0;";
        // parallel assignment short cut
        list($result, $valid) = DoQuery($sql, $connection);
        // output only if we have anything
        if ($result && $valid) {
            $row = mysqli_fetch_array($result);
            $password = $row['HashPassword'];
            $salt = $row['Salt'];
            // don't share the hashed pw either
            $options = ['cost' => 11, 'salt' => $salt];
            $newhash = password_hash($password, PASSWORD_BCRYPT, $options);
            // check stored hash against the regenerated value
            if ($secondpw == $newhash) {
                return true;
            } else {
                return false;
            }
        } else {
            return false;
        }
    } else {
        return false;
    }
}
开发者ID:Roblix711,项目名称:AssistMe,代码行数:36,代码来源:core.php

示例2: getPass

function getPass($username)
{
    global $table_prefix;
    $q = DoQuery("SELECT user_password FROM {$table_prefix}users WHERE username='{$username}'");
    $pass = Do_Fetch_Row($q);
    return $pass[0];
}
开发者ID:BackupTheBerlios,项目名称:domsmod-svn,代码行数:7,代码来源:phpbb2.php

示例3: getPass

function getPass($username)
{
    global $SERVER;
    $q = DoQuery("SELECT password FROM {$SERVER['TBL_PREFIX']}users WHERE username='{$username}'");
    $pass = Do_Fetch_Row($q);
    return $pass[0];
}
开发者ID:BackupTheBerlios,项目名称:domsmod-svn,代码行数:7,代码来源:md5.php

示例4: getPass

function getPass($username)
{
    global $INFO, $DATABASE, $_COOKIE, $SERVER;
    mysql_close();
    mysql_connect($INFO['sql_host'], $INFO['sql_user'], $INFO['sql_pass']);
    mysql_select_db($INFO['sql_database']);
    $q = DoQuery("SELECT password FROM {$INFO[sql_tbl_prefix]}members WHERE name='{$username}'");
    echo mysql_error();
    $pass = Do_Fetch_Row($q);
    mysql_close();
    DoConnect($DATABASE['HOST'], $DATABASE['USER'], $DATABASE['PASS']);
    DoSelectDb($DATABASE['DATABASE']);
    $q = DoQuery("SELECT * FROM {$SERVER['TBL_PREFIX']}users WHERE username='{$username}'");
    $row = Do_Fetch_Row($q);
    if ($row[0] == "" && $_COOKIE['X2CHATP'] == $pass[0]) {
        DoQuery("INSERT INTO {$SERVER['TBL_PREFIX']}users VALUES('0','{$username}','','','1','','','','','','','','','14000,1000,1,1,0,3,1,0,0,1')");
    }
    return $pass[0];
}
开发者ID:BackupTheBerlios,项目名称:domsmod-svn,代码行数:19,代码来源:invision.php

示例5: getPass

function getPass($username)
{
    global $nukepre, $nuke, $DATABASE, $SERVER, $_COOKIE;
    mysql_close();
    mysql_connect($nuke['DBHOST'], $nuke['UNAME'], $nuke['PWORD']);
    mysql_select_db($nuke['DBNAME']);
    $q = DoQuery("SELECT user_password FROM {$nukepre}users WHERE username='{$username}'");
    echo mysql_error();
    $pass = Do_Fetch_Row($q);
    mysql_close();
    DoConnect($DATABASE['HOST'], $DATABASE['USER'], $DATABASE['PASS']);
    DoSelectDb($DATABASE['DATABASE']);
    $q = DoQuery("SELECT * FROM {$SERVER['TBL_PREFIX']}users WHERE username='{$username}'");
    $row = Do_Fetch_Row($q);
    if ($row[0] == "" && $_COOKIE['X2CHATP'] == $pass[0]) {
        DoQuery("INSERT INTO {$SERVER['TBL_PREFIX']}users VALUES('0','{$username}','','','1','','','','','','','','','14000,1000,1,1,0,3,1,0,0,1')");
    }
    return $pass[0];
}
开发者ID:BackupTheBerlios,项目名称:domsmod-svn,代码行数:19,代码来源:nuke.php

示例6: getPass

function getPass($username)
{
    global $DATABASE, $_COOKIE, $SERVER, $xmb_host, $xmb_user, $xmb_password, $xmb_db, $xmb_prefix;
    mysql_close();
    @DoConnect("{$xmb_host}", "{$xmb_user}", "{$xmb_password}");
    @DoSelectDb("{$xmb_db}");
    $q = DoQuery("SELECT password FROM {$xmb_prefix}members WHERE username='{$username}'");
    echo mysql_error();
    $pass = Do_Fetch_Row($q);
    mysql_close();
    DoConnect($DATABASE['HOST'], $DATABASE['USER'], $DATABASE['PASS']);
    DoSelectDb($DATABASE['DATABASE']);
    $q = DoQuery("SELECT * FROM {$SERVER['TBL_PREFIX']}users WHERE username='{$username}'");
    $row = Do_Fetch_Row($q);
    if ($row[0] == "" && $_COOKIE['X2CHATP'] == $pass[0]) {
        DoQuery("INSERT INTO {$SERVER['TBL_PREFIX']}users VALUES('0','{$username}','','','1','','','','','','','','','14000,1000,1,1,0,3,1,0,0,1')");
        echo mysql_error();
    }
    return $pass[0];
}
开发者ID:BackupTheBerlios,项目名称:domsmod-svn,代码行数:20,代码来源:xmb.php

示例7: TransactionQuery

function TransactionQuery($sqlmultipleinput, $connection)
{
    // turn off autocommit, and then start a transaction
    mysqli_autocommit($connection, FALSE);
    mysqli_begin_transaction($connection, MYSQLI_TRANS_START_READ_ONLY);
    $i = 0;
    $output = "";
    foreach ($sqlmultipleinput as $sql) {
        // replace SpecialLastID with mysql_insert_id($connection)
        $sql = str_replace("SpecialLastID", "" . mysqli_insert_id($connection) . "", $sql);
        //echo "Query = ".$sql."\n";
        // do query
        list($result, $valid) = DoQuery($sql, $connection);
        $outout[$i] = array($result, $valid);
        $i++;
    }
    // end commit transaction, and set autocommit for future
    $transresult = mysqli_commit($connection);
    mysqli_autocommit($connection, TRUE);
    return array($transresult, $output);
}
开发者ID:Roblix711,项目名称:AssistMe,代码行数:21,代码来源:connection.php

示例8: DoQuery

            DoQuery("INSERT INTO {$SERVER['TBL_PREFIX']}settings VALUES('0','style_winbg2','#b3b3b3')");
            DoQuery("INSERT INTO {$SERVER['TBL_PREFIX']}settings VALUES('0','style_cs1','#cdcdcd')");
            DoQuery("INSERT INTO {$SERVER['TBL_PREFIX']}settings VALUES('0','style_cs3','#cdcdcd')");
            DoQuery("INSERT INTO {$SERVER['TBL_PREFIX']}settings VALUES('0','style_cs2','#000000')");
            DoQuery("INSERT INTO {$SERVER['TBL_PREFIX']}settings VALUES('0','style_msgboxbg','#b3b3b3')");
            DoQuery("INSERT INTO {$SERVER['TBL_PREFIX']}settings VALUES('0','style_ltfont','#000000')");
            DoQuery("INSERT INTO {$SERVER['TBL_PREFIX']}settings VALUES('0','style_dkfont','#000000')");
            DoQuery("INSERT INTO {$SERVER['TBL_PREFIX']}settings VALUES('0','style_deffont','#000000')");
            DoQuery("INSERT INTO {$SERVER['TBL_PREFIX']}settings VALUES('0','bgimage','')");
            DoQuery("INSERT INTO {$SERVER['TBL_PREFIX']}settings VALUES('0','news','')");
            DoQuery("INSERT INTO {$SERVER['TBL_PREFIX']}settings VALUES('0','maxlog','1048576')");
            DoQuery("INSERT INTO {$SERVER['TBL_PREFIX']}settings VALUES('0','defband','0')");
            DoQuery("INSERT INTO {$SERVER['TBL_PREFIX']}settings VALUES('0','style_sysmsg','#ff0000')");
            DoQuery("INSERT INTO {$SERVER['TBL_PREFIX']}settings VALUES('0','style_otherusers','#ff0000')");
            DoQuery("INSERT INTO {$SERVER['TBL_PREFIX']}settings VALUES('0','style_youruser','#001068')");
            DoQuery("INSERT INTO {$SERVER['TBL_PREFIX']}settings VALUES('0','serveroffset','0')");
        } else {
        }
    }
}
printct(700, 700, "<font size=\"6\"><div align=\"center\">{$txt['249']}{$step}</div></font>", $body, "#CDCDCD", "#CDCDCD", "#EEEEEE");
?>
<div align="center"><Br><Br><Br>
<a href="http://www.x7chat.com"><img src="images/copyright.png" border="0"></a>
<Br><font size="2"><?php 
echo $txt[76];
?>
</font>
<Br><font size="2"><?php 
echo $txt[77];
?>
开发者ID:BackupTheBerlios,项目名称:domsmod-svn,代码行数:31,代码来源:install.php

示例9: time

 $msg = "[font={$fontface}]" . $msg . "[/font]";
 if ($normal != "on") {
     if ($italic == "on") {
         $msg = "[i]" . $msg . "[/i]";
     }
     if ($bold == "on") {
         $msg = "[b]" . $msg . "[/b]";
     }
     if (@$underline == "on") {
         $msg = "[u]" . $msg . "[/u]";
     }
 }
 $floodcount = 1;
 $time = time();
 $oldtime = time() - 1;
 $q = DoQuery("SELECT * FROM {$SERVER['TBL_PREFIX']}messages WHERE user='{$XUSER['NAME']}'");
 while ($row = Do_Fetch_Row($q)) {
     if ($row[3] == $time || $row[3] == $oldtime) {
         $floodcount++;
     }
 }
 if ($floodcount > $SERVER['MAX_MPS']) {
     $to2 = "{$XUSER['NAME']}:PRIV";
     $temp = $SERVER['MAX_MPS'] / 2;
     $msg2 = "{$txt['309']} {$temp} {$txt['310']}";
     sendsysmsgto($msg2, $to2);
 } else {
     if (isset($to)) {
         $tmsg = eregi_replace("'", "\\'", $msg);
         sendprivatemsg($tmsg, $to);
         $submsg = codeparse($msg);
开发者ID:BackupTheBerlios,项目名称:domsmod-svn,代码行数:31,代码来源:send.php

示例10: DoQuery

<?php

require_once "database.php";

$type = $_REQUEST["type"];
$ret = DoQuery($type);
echo $ret;

function DoQuery($t) {
	$str = "{\"result\":0, \"data\":[";
	$db = openConnection();
	$stmt = $db->prepare("select id, nickname, comment, photo1, photo2, photo3, photo4, photo5, commit_date from feedback where status = ? order by id desc");
	$stmt->bind_param("i", $t);
	$stmt->execute();
	$id = 0;
	$nickname = "";
	$comment = "";
	$photo1 = "";
	$photo2 = "";
	$photo3 = "";
	$photo4 = "";
	$photo5 = "";
	$commit_date = "";
	$stmt->bind_result($id, $nickname, $comment, $photo1, $photo2, $photo3, $photo4, $photo5, $commit_date);
	while ($stmt->fetch()) {
		$str .= "{\"id\":${id},\"nickname\":".json_encode($nickname).",\"comment\":".json_encode($comment).",\"photo1\":\"${photo1}\",\"photo2\":\"${photo2}\",\"photo3\":\"${photo3}\",\"photo4\":\"${photo4}\",\"photo5\":\"${photo5}\",\"commit_date\":\"${commit_date}\"},"; 
	}
	$stmt->close();
	closeConnection($db);
	$str = rtrim($str, ",");
	$str .= "]}";
开发者ID:rarnu,项目名称:root-tools,代码行数:31,代码来源:query_feedback.php

示例11: DoQuery

}
if (!empty($_POST['number'])) {
    $number = $_POST['number'];
    $query .= " AND customers.number = '{$number}'";
}
if (!empty($_POST['postalcode'])) {
    $postalcode = $_POST['postalcode'];
    $query .= " AND customers.postalcode = '{$postalcode}'";
}
if (!empty($_POST['city'])) {
    $city = $_POST['city'];
    $query .= " AND customers.city = '{$city}'";
}
if (!empty($_POST['ccn'])) {
    $ccn = $_POST['ccn'];
    $query .= " AND customers.ccn = '{$ccn}'";
}
if (!empty($_POST['phone_number_1'])) {
    $phone_number_1 = $_POST['phone_number_1'];
    $query .= " AND customer_phone.phone_number = '{$phone_number_1}'";
} else {
    if (!empty($_POST['phone_number_2'])) {
        $phone_number_2 = $_POST['phone_number_2'];
        $query .= " AND customer_phone.phone_number = '{$phone_number_2}'";
    }
}
$query .= ";";
$customers = DoQuery($query);
include 'customers_vip.php';
include 'views/customers_view.php';
include 'views/footer.php';
开发者ID:panayiotisd,项目名称:ntua-db,代码行数:31,代码来源:customers_doSearch.php

示例12: DoQuery

    DoQuery("UPDATE {$SERVER['TBL_PREFIX']}settings SET value='#000000' WHERE name = 'style_cs2'");
    DoQuery("UPDATE {$SERVER['TBL_PREFIX']}settings SET value='#b3b3b3' WHERE name = 'style_msgboxbg'");
    DoQuery("UPDATE {$SERVER['TBL_PREFIX']}settings SET value='#000000' WHERE name = 'style_ltfont'");
    DoQuery("UPDATE {$SERVER['TBL_PREFIX']}settings SET value='#000000' WHERE name = 'style_dkfont'");
    DoQuery("UPDATE {$SERVER['TBL_PREFIX']}settings SET value='#000000' WHERE name = 'style_deffont'");
    // Insert New Variables
    DoQuery("INSERT INTO {$SERVER['TBL_PREFIX']}settings VALUES('0','bgimage','')");
    DoQuery("INSERT INTO {$SERVER['TBL_PREFIX']}settings VALUES('0','news','')");
    DoQuery("INSERT INTO {$SERVER['TBL_PREFIX']}settings VALUES('0','maxlog','1048576')");
    DoQuery("INSERT INTO {$SERVER['TBL_PREFIX']}settings VALUES('0','defband','0')");
    DoQuery("INSERT INTO {$SERVER['TBL_PREFIX']}settings VALUES('0','style_sysmsg','#ff0000')");
    DoQuery("INSERT INTO {$SERVER['TBL_PREFIX']}settings VALUES('0','style_otherusers','#ff0000')");
    DoQuery("INSERT INTO {$SERVER['TBL_PREFIX']}settings VALUES('0','style_youruser','#001068')");
    DoQuery("INSERT INTO {$SERVER['TBL_PREFIX']}settings VALUES('0','serveroffset','0')");
    // Update old permissions table to allow admins to access bandwidth settings
    DoQuery("UPDATE {$SERVER['TBL_PREFIX']}permissions SET Edit_Bandwidth='1' WHERE user='DEFAULT_4'");
    if ($didfail == 1) {
        $body .= "<br><br>{$txt['411']}<a href=\"upgrade.php?step=3&override=true\"><font color=\"#EEEEEE\">{$txt['40']}</font></a><Br>";
    } else {
        $body .= "<Br><Br>{$txt['412']}</div>";
    }
}
printct(700, 700, "<font size=\"6\"><div align=\"center\">{$txt['408']}{$step}</div></font>", $body, "#CDCDCD", "#CDCDCD", "#EEEEEE");
?>
<div align="center"><Br><Br><Br>
<a href="http://www.x7chat.com"><img src="images/copyright.png" border="0"></a>
<Br><font size="2"><?php 
echo $txt[76];
?>
</font>
<Br><font size="2"><?php 
开发者ID:BackupTheBerlios,项目名称:domsmod-svn,代码行数:31,代码来源:upgrade.php

示例13: DoQuery

    $error = 1;
}
if (strtoupper($username) == "DEFAULT_4" || strtoupper($username) == "DEFAULT_1") {
    $body = "{$txt['194']}";
    $error = 1;
}
$q = DoQuery("SELECT * FROM {$SERVER['TBL_PREFIX']}users WHERE email='{$email}'");
while ($row = Do_Fetch_Row($q)) {
    $body = "{$txt['440']}";
    $error = 1;
}
$pass1 = doXEncrypt($pass1);
if (!isset($error)) {
    $q = DoQuery("SELECT value FROM {$SERVER['TBL_PREFIX']}settings WHERE name='serveroffset'");
    $row = Do_Fetch_Row($q);
    $settings = "14000,5000,1,1,0,3,1,{$row['0']},0,1";
    $time = time();
    $err = DoQuery("INSERT INTO {$SERVER['TBL_PREFIX']}users \nVALUES('0','{$username}','{$pass1}','{$email}','1','{$avatar}','{$realname}','{$location}',\n'{$hobbies}','{$bio}','','1','{$time}','{$settings}')");
    if ($err == 1) {
        $body = "<Br>{$txt['195']}<Br><Br><a href=\"index.php\">{$txt['196']}</a><Br><Br>";
    } else {
        $body = "Sorry a database error occured:<Br>{$err}<Br><Br>";
    }
}
printct(700, 700, "<font size=\"6\"><div align=\"center\">{$txt['197']}</div></font>", "<div align=\"Center\">{$body}</div>", "{$CS['1']}", "{$CS['2']}", "{$CS['3']}");
?>
<Br><Br><Br>
<div align="center"><font size="2">Powered By <a href="http://www.x7chat.com/" target="_blank">X7 Chat</a> 1.3.6B<Br>&copy; 2004 By The <a href="http://www.x7chat.com/" target="_blank">X7 Group</a></font></div>
</body>
</html>
开发者ID:BackupTheBerlios,项目名称:domsmod-svn,代码行数:30,代码来源:register.php

示例14: elseif

} elseif ($action == "voice") {
    $q = DoQuery("SELECT * FROM {$SERVER['TBL_PREFIX']}users WHERE id='{$userid}'");
    $row = Do_Fetch_Row($q);
    $q3 = DoQuery("SELECT * FROM {$SERVER['TBL_PREFIX']}online WHERE username='{$row['1']}'");
    $row3 = Do_Fetch_Row($q3);
    if ($row3[3] != $ROOMS['IN_ROOM_NAME']) {
        $head = $txt[2];
        $body = $txt[185];
    } else {
        if ($row[4] < 4 && $row[11] != $ROOMS['id']) {
            mnotice($row[1], 5);
            $head = $txt[186];
            $body = "{$txt['187']}<Br><Br><a href=\"index.php\">{$txt['6']}</a><br><Br>";
            DoQuery("UPDATE {$SERVER['TBL_PREFIX']}users SET voice='{$ROOMS['id']}' WHERE id='{$userid}'");
        } elseif ($row[11] == $ROOMS['id']) {
            DoQuery("UPDATE {$SERVER['TBL_PREFIX']}users SET voice='' WHERE id='{$userid}'");
            mnotice($row[1], 6);
            $head = $txt[188];
            $body = "{$txt['189']}<Br><Br><a href=\"index.php\">{$txt['6']}</a><br><Br>";
        } else {
            $head = $txt[2];
            $body = $txt[176];
        }
    }
}
printct(700, 700, "<font size=\"6\"><div align=\"center\">{$head}</div></font>", "<div align=\"center\">{$body}<Br><Br></div>", "{$CS['1']}", "{$CS['2']}", "{$CS['3']}");
?>
<Br><Br><Br>
<div align="center"><font size="2">Powered By <a href="http://www.x7chat.com/" target="_blank">X7 Chat</a> 1.3.6B<Br>&copy; 2004 By The <a href="http://www.x7chat.com/" target="_blank">X7 Group</a></font></div>
</body>
</html>
开发者ID:BackupTheBerlios,项目名称:domsmod-svn,代码行数:31,代码来源:roomcontrol.php

示例15: DoQuery

        include 'views/faq_view.php';
        break;
    case 6:
        $query = "SELECT\n\t\t\t\th.name,h.city,h.rate\n\t\t\tFROM\n\t\t\t\thotels h,hotel_service hs\n\t\t\tWHERE\n\t\t\t\th.hotel_id=hs.hotel_id AND\n\t\t\t\ths.service='Wifi' AND\n\t\t\t\th.name\n\t\t\tIN (\n\t\t\t\tSELECT\n\t\t\t\t\th.name\n\t\t\t\tFROM\n\t\t\t\t\thotels h, hotel_service hs\n\t\t\t\tWHERE\n\t\t\t\t\th.hotel_id=hs.hotel_id AND\n\t\t\t\t\ths.service='Gym'\n\t\t\t\t);";
        $results = DoQuery($query);
        include 'views/faq_view.php';
        break;
    case 7:
        $query = "SELECT\n\t\t\t\thotels.name, avg(salary),min(salary),max(salary)\n\t\t\tFROM \n\t\t\t\thotels CROSS JOIN employees\n\t\t\tON\n\t\t\t\thotels.hotel_id=employees.hotel_id\n\t\t\tGROUP BY\n\t\t\t\thotels.name;";
        $results = DoQuery($query);
        include 'views/faq_view.php';
        break;
    case 8:
        $query = "SELECT\n\t\t\t\thotels.name, hotels.rate, avg(price),min(price),max(price)\n\t\t\tFROM \n\t\t\t\thotels CROSS JOIN rooms\n\t\t\tON\n\t\t\t\thotels.hotel_id=rooms.hotel_id\n\t\t\tGROUP BY\n\t\t\t\thotels.name;";
        $results = DoQuery($query);
        include 'views/faq_view.php';
        break;
    case 9:
        $query = "SELECT \n\t\t\t\thotels.name, hotels.rate\n\t\t\tFROM\n\t\t\t\thotels\n\t\t\tWHERE\n\t\t\t\thotels.construction_year>2000\n\t\t\tORDER BY\n\t\t\t\thotels.rate DESC;";
        $results = DoQuery($query);
        include 'views/faq_view.php';
        break;
    case 10:
        $query = "SELECT\n\t\t\t\tc.name, c.surname , count(*)\n\t\t\tFROM\n\t\t\t\tcustomers c, reservations r \n\t\t\tWHERE\n\t\t\t\tr.customer_id=c.customer_id\n\t\t\tGROUP BY\n\t\t\t\tr.customer_id;";
        $results = DoQuery($query);
        include 'views/faq_view.php';
        break;
    default:
        echo "<div class='error'>Μη έγκυρο ερώτημα!</div>";
}
include 'views/footer.php';
开发者ID:panayiotisd,项目名称:ntua-db,代码行数:31,代码来源:faq_view.php


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