mirror of https://github.com/BOINC/boinc.git
- web: add DbConn::max() function
svn path=/trunk/boinc/; revision=25711
This commit is contained in:
parent
08a529cb86
commit
2db88e20a8
|
@ -37,7 +37,7 @@ function friendly_name($p) {
|
||||||
}
|
}
|
||||||
if (strlen($pc)) {
|
if (strlen($pc)) {
|
||||||
if (strstr($pc, 'cuda')) $q .= " (NVIDIA GPU)";
|
if (strstr($pc, 'cuda')) $q .= " (NVIDIA GPU)";
|
||||||
else if (strstr($pc, 'ati')) $q .= " (ATI GPU)";
|
else if (strstr($pc, 'ati')) $q .= " (AMD/ATI GPU)";
|
||||||
else if (strstr($pc, 'mt')) $q .= " (multicore)";
|
else if (strstr($pc, 'mt')) $q .= " (multicore)";
|
||||||
}
|
}
|
||||||
return $q;
|
return $q;
|
||||||
|
|
|
@ -152,6 +152,14 @@ class DbConn {
|
||||||
if ($cnt) return (double)$cnt->total;
|
if ($cnt) return (double)$cnt->total;
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
function max($table, $field, $clause="") {
|
||||||
|
$query = "select max($field) as total from ".$this->db_name.".$table $clause";
|
||||||
|
$result = $this->do_query($query);
|
||||||
|
$cnt = mysql_fetch_object($result);
|
||||||
|
mysql_free_result($result);
|
||||||
|
if ($cnt) return (double)$cnt->total;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
function replace($table, $clause) {
|
function replace($table, $clause) {
|
||||||
$query = "replace into ".$this->db_name.".$table set $clause";
|
$query = "replace into ".$this->db_name.".$table set $clause";
|
||||||
return $this->do_query($query);
|
return $this->do_query($query);
|
||||||
|
|
Loading…
Reference in New Issue