From 2db88e20a8ebdddf6c27c946f7470ed76be17658 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 25 May 2012 18:44:56 +0000 Subject: [PATCH] - web: add DbConn::max() function svn path=/trunk/boinc/; revision=25711 --- doc/get_platforms.inc | 2 +- html/inc/db_conn.inc | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/get_platforms.inc b/doc/get_platforms.inc index c80bb98bab..e67735b9d5 100644 --- a/doc/get_platforms.inc +++ b/doc/get_platforms.inc @@ -37,7 +37,7 @@ function friendly_name($p) { } if (strlen($pc)) { 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)"; } return $q; diff --git a/html/inc/db_conn.inc b/html/inc/db_conn.inc index 930b58b974..ab00049693 100644 --- a/html/inc/db_conn.inc +++ b/html/inc/db_conn.inc @@ -152,6 +152,14 @@ class DbConn { if ($cnt) return (double)$cnt->total; 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) { $query = "replace into ".$this->db_name.".$table set $clause"; return $this->do_query($query);