summaryrefslogtreecommitdiff
path: root/framework/Data/TDbCommand.php
diff options
context:
space:
mode:
authorxue <>2007-02-23 14:36:02 +0000
committerxue <>2007-02-23 14:36:02 +0000
commit0aa6313662914dcead8adacf68bec3398c2e0dc7 (patch)
tree00fe561bc85b7d1e527563be3070de9845459390 /framework/Data/TDbCommand.php
parent4120455c97fb3824dea972b21fd825b3d6b50006 (diff)
Added TDbCache.
Diffstat (limited to 'framework/Data/TDbCommand.php')
-rw-r--r--framework/Data/TDbCommand.php17
1 files changed, 8 insertions, 9 deletions
diff --git a/framework/Data/TDbCommand.php b/framework/Data/TDbCommand.php
index 102bdf34..f5d7d647 100644
--- a/framework/Data/TDbCommand.php
+++ b/framework/Data/TDbCommand.php
@@ -180,7 +180,9 @@ class TDbCommand extends TComponent
{
try
{
- Prado::trace('Execute Command: '.$this->getDebugStatementText(), 'System.Data');
+ // Do not trace because it will remain even in
+ // Performance mode or when pradolite.php is used
+ // Prado::trace('Execute Command: '.$this->getDebugStatementText(), 'System.Data');
if($this->_statement instanceof PDOStatement)
{
$this->_statement->execute();
@@ -216,7 +218,7 @@ class TDbCommand extends TComponent
{
try
{
- Prado::trace('Query: '.$this->getDebugStatementText(), 'System.Data');
+ // Prado::trace('Query: '.$this->getDebugStatementText(), 'System.Data');
if($this->_statement instanceof PDOStatement)
$this->_statement->execute();
else
@@ -241,7 +243,7 @@ class TDbCommand extends TComponent
{
try
{
- Prado::trace('Query Row: '.$this->getDebugStatementText(), 'System.Data');
+ // Prado::trace('Query Row: '.$this->getDebugStatementText(), 'System.Data');
if($this->_statement instanceof PDOStatement)
$this->_statement->execute();
else
@@ -260,24 +262,21 @@ class TDbCommand extends TComponent
* Executes the SQL statement and returns the value of the first column in the first row of data.
* This is a convenient method of {@link query} when only a single scalar
* value is needed (e.g. obtaining the count of the records).
- * @return mixed the value of the first column in the first row of the query result.
+ * @return mixed the value of the first column in the first row of the query result. False is returned if there is no value.
* @throws TDbException execution failed or there is no data
*/
public function queryScalar()
{
try
{
- Prado::trace('Query Scalar: '.$this->getDebugStatementText(), 'System.Data');
+ // Prado::trace('Query Scalar: '.$this->getDebugStatementText(), 'System.Data');
if($this->_statement instanceof PDOStatement)
$this->_statement->execute();
else
$this->_statement=$this->getConnection()->getPdoInstance()->query($this->getText());
$result=$this->_statement->fetchColumn();
$this->_statement->closeCursor();
- if($result!==false)
- return $result;
- else
- throw new TDbException('dbcommand_column_empty');
+ return $result;
}
catch(Exception $e)
{