本文整理汇总了PHP中DbConn::executeQuery方法的典型用法代码示例。如果您正苦于以下问题:PHP DbConn::executeQuery方法的具体用法?PHP DbConn::executeQuery怎么用?PHP DbConn::executeQuery使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DbConn
的用法示例。
在下文中一共展示了DbConn::executeQuery方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkLogin
public static function checkLogin($userName, $password)
{
$sql = "select * from manager where userName='{$userName}' and password='{$password}'";
$conn = new DbConn();
$result = $conn->executeQuery($sql);
$conn->close();
return $result[0];
}
示例2: getNewsTypes
public static function getNewsTypes()
{
$sql = "select * from newsTypes";
$conn = new DbConn();
$result = $conn->executeQuery($sql);
$conn->freeResult();
$conn->close();
return $result;
}
示例3: getReviews
public static function getReviews($articleId)
{
$sql = "select * from reviews where articleId={$articleId}";
$conn = new DbConn();
$result = $conn->executeQuery($sql);
$conn->freeResult();
$conn->close();
return $result;
}
示例4: array
// Dateiname: public_vars.php
$PUBLICVARS = array();
/* ---------------------------------------
Globale Variablen-Definitionen
--------------------------------------- */
$url = parse_url(__FILE__);
$currPath = dirname($url['path']);
if (substr($currPath, strlen($currPath) - 1) != "/" && strlen($currPath) > 1) {
$currPath .= "/";
}
include $currPath . "dbConnect.php";
$dc = new DbConn($DBHOST, $DBUSER, $DBPASS, $DBNAME);
// Muss immer neu geladen werden,
// da Session hier noch nicht gestartet werden kann weil Klassen noch nicht geladen sind!
$sql = "select name, value from pageconfig ";
$res = $dc->executeQuery($sql);
while ($row = mysql_fetch_array($res)) {
$PUBLICVARS[$row['name']] = $row['value'];
}
class DbConn
{
var $host;
var $user;
var $pass;
var $dbname;
var $db_link = false;
function DbConn($DBHOST, $DBUSER, $DBPASS, $DBNAMEX)
{
//Konstruktor
$this->host = $DBHOST;
$this->user = $DBUSER;
示例5: getNewsTwo
public static function getNewsTwo($typeId)
{
$sql = "select * from newsArticles where typeId={$typeId} order by dateandtime desc limit 0,2";
$conn = new DbConn();
$result = $conn->executeQuery($sql);
$conn->freeResult();
$conn->close();
return $result;
}