diff options
Diffstat (limited to 'framework/Data')
-rw-r--r-- | framework/Data/TDbCommand.php | 17 | ||||
-rw-r--r-- | framework/Data/TDbConnection.php | 6 |
2 files changed, 11 insertions, 12 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)
{
diff --git a/framework/Data/TDbConnection.php b/framework/Data/TDbConnection.php index be61e0a4..55d2710c 100644 --- a/framework/Data/TDbConnection.php +++ b/framework/Data/TDbConnection.php @@ -79,9 +79,9 @@ Prado::using('System.Data.TDbCommand'); */
class TDbConnection extends TComponent
{
- private $_dsn;
- private $_username;
- private $_password;
+ private $_dsn='';
+ private $_username='';
+ private $_password='';
private $_attributes=array();
private $_active=false;
private $_pdo=null;
|