本文整理汇总了PHP中mysql::result方法的典型用法代码示例。如果您正苦于以下问题:PHP mysql::result方法的具体用法?PHP mysql::result怎么用?PHP mysql::result使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mysql
的用法示例。
在下文中一共展示了mysql::result方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: query
private static function query($q, $params = array())
{
if (self::$link === NULL) {
self::connect();
}
self::$numQuerys++;
$q .= self::$order;
$q .= self::$limit;
self::$order = '';
self::$limit = '';
self::$sql = $q;
self::$result = mysql_query($q, self::$link);
if (!self::$result) {
return false;
} else {
if (!is_resource(self::$result)) {
return true;
}
}
$rset = array();
while ($row = mysql_fetch_assoc(self::$result)) {
$rset[] = $row;
}
return $rset;
}
示例2: die
static function sql_query($sql)
{
if ($sql) {
if (is_array($sql)) {
for ($i = 0; $i < count($sql); $i++) {
if (!self::sql_query($sql[$i])) {
die("Could not run sql query array.<br/>" . $sql[$i]);
}
}
return;
}
self::$query = $sql;
self::$num++;
self::$result = mysql_query($sql);
if (!self::$result) {
die("Could not run sql query.<br/>" . $sql);
}
return self::$result;
} else {
return false;
}
}
示例3: mysql
<?php
include 'db_connect.php';
include 'query_auswertung.php';
include 'diagramm.php';
// Das ist ein Sicherheisproblem (mysql injection) ...
#$idRun = $_GET["idrun"] ; // wenn null wird einfach der letzte run ausgewertet
$sql = new mysql("localhost", "xtStats", "123", "xtStats");
$qlastrunid = $sql->query("SELECT idRun FROM run order by date desc LIMIT 1;");
$idRun = $sql->result(0, 'idRun', $qlastrunid);
$result = $sql->query("\nSELECT\n\tROUND(AVG(c.durationMs)) AS avgCpp,\n\tROUND(AVG(h.durationMs)) AS avgHas,\n\tCOUNT(c.id) AS countCpp,\n\tCOUNT(h.id) AS countHas\nFROM\n\tresult AS c\nINNER JOIN result AS h ON\n\th.type = 5 AND\n\th.blame = 0 AND\n\th.testcaseId = 0 AND\n\th.idRun = c.idRun AND\n\th.idTestfile = c.idTestfile\nWHERE\n\tc.idRun = '" . $idRun . "' AND\n\tc.testcaseId = 0 AND\n\tc.type = 2 AND\n\tc.blame = 0\n;");
$statsCompile = array();
while ($line = mysql_fetch_array($result)) {
$statsCompile[] = $line;
}
$result = $sql->query("\nSELECT\n\tROUND(AVG(c.durationMs)) AS avgCpp,\n\tROUND(AVG(h.durationMs)) AS avgHas,\n\tROUND(AVG(i.durationMs)) AS avgInt,\n\tCOUNT(c.id) AS countCpp,\n\tCOUNT(h.id) AS countHas,\n\tCOUNT(i.id) AS countInt\nFROM\n\tresult AS c\nINNER JOIN result AS h ON\n\th.idRun = c.idRun AND\n\th.testcaseId = c.testcaseId AND\n\th.idTestfile = c.idTestfile AND\n\th.type = 5 AND\n\th.blame = 0\nINNER JOIN result AS i ON\n\ti.idRun = c.idRun AND\n\ti.testcaseId = c.testcaseId AND\n\ti.idTestfile = c.idTestfile AND\n\ti.type = 1 AND\n\ti.blame = 0\nWHERE\n\tc.idRun = '" . $idRun . "' AND\n\tc.testcaseId > 0 AND\n\tc.type = 2 AND\n\tc.blame = 0\n;");
$statsExec = array();
while ($line = mysql_fetch_array($result)) {
$statsExec[] = $line;
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Cross Testing</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script src="scripts/jquery.min.js"></script>
<script src="scripts/highcharts.js"></script>
示例4:
static function sql_prepare($sql)
{
if ($sql) {
$stmt = self::$db->prepare($sql);
self::$result = $stmt;
return self::$result;
} else {
return false;
}
}