diff options
author | jhunkeler <jhunkeler@c5b2fb0a-d05d-0410-98c8-828840a80ff6> | 2009-12-23 12:38:13 -0500 |
---|---|---|
committer | jhunkeler <jhunkeler@c5b2fb0a-d05d-0410-98c8-828840a80ff6> | 2009-12-23 12:38:13 -0500 |
commit | ebda82d787b3620424c1dcf4336146ea06815a55 (patch) | |
tree | c05021cb36da9eff4c589e67824f237500b01149 /includes/sql.class.php | |
parent | 6c42f30a0424cbf1c1af63f21d7f5074a4653c7a (diff) | |
download | bayonetcms-ebda82d787b3620424c1dcf4336146ea06815a55.tar.gz |
New debugging methods implements.
config.php has two new options, "show_messages", and "repeat messages".
If a "show_messages" is enabled any decho statements are rendered
above the site footer.
git-svn-id: http://svn.3rd-infantry-division.org/testing/branches/Bayonet CMS v2@395 c5b2fb0a-d05d-0410-98c8-828840a80ff6
Diffstat (limited to 'includes/sql.class.php')
-rw-r--r-- | includes/sql.class.php | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/includes/sql.class.php b/includes/sql.class.php index 57fdd5d..0dcd0d5 100644 --- a/includes/sql.class.php +++ b/includes/sql.class.php @@ -16,7 +16,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ - + static $db_queries = 0; static $db_connections = 0; static $db_frees = 0; @@ -68,6 +68,7 @@ class Bayonet_SQL }catch(Exception $e){ } */ + return mysql_query($str); } @@ -75,12 +76,12 @@ class Bayonet_SQL { global $db_frees; ++$db_frees; - //decho("Freeing ('$result')"); + decho("Freeing result"); return mysql_free_result($result); } public function Fetch($result) - { + { return $this->FetchArray($result); } @@ -88,7 +89,8 @@ class Bayonet_SQL { global $db_fetches; ++$db_fetches; - /* Alias Fetch() prefered, so no decho information */ + /* Alias Fetch() prefered, so no decho information */ + decho("Fetching result"); return mysql_fetch_array($result,MYSQL_ASSOC); } @@ -96,6 +98,7 @@ class Bayonet_SQL { global $db_fetches; ++$db_fetches; + decho("Fetching object result"); return mysql_fetch_object($result,$class); } @@ -103,16 +106,19 @@ class Bayonet_SQL { global $db_fetches; ++$db_fetches; + decho("Fetching assoc result"); return mysql_fetch_assoc($result); } public function FetchRow($result) { + decho("Fetching single row"); return mysql_fetch_row($result); } public function Rows($result) { + decho("Fetching number of rows"); return mysql_num_rows($result); } } |