Changeset 323 for trunk/database.php
- Timestamp:
- Nov 28, 2011, 8:50:09 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/database.php
r320 r323 35 35 var $insert_id; 36 36 var $LastQuery = ''; 37 var $ShowSQLError = false; 38 var $ShowSQLQuery = false; 37 39 38 40 function __construct($Host, $User, $Password, $Database) … … 51 53 function query($Query) 52 54 { 53 global $Config;54 55 55 $this->LastQuery = $Query; 56 if($ Config['Web']['ShowSQLQuery']== true)56 if($this->ShowSQLQuery == true) 57 57 echo('<div style="border-bottom-width: 1px; border-bottom-style: solid; padding-bottom: 3px; padding-top: 3px; font-size: 12px; font-family: Arial;">'.$Query.'</div>'."\n"); 58 58 $Result = new DatabaseResult(); 59 59 $Result->PDOStatement = $this->PDO->query($Query); 60 $Result->num_rows = $Result->PDOStatement->rowCount(); 61 if(($this->Error != '') and ($Config['Web']['ShowSQLError'] == true)) 62 echo('<div><strong>SQL Error: </strong>'.$this->Error.'<br />'.$Query.'</div>'); 63 60 if($Result) 61 { 62 $Result->num_rows = $Result->PDOStatement->rowCount(); 63 } else 64 { 65 $this->Error = $this->errorInfo[2]; 66 if(($this->Error != '') and ($this->ShowSQLError == true)) 67 echo('<div><strong>SQL Error: </strong>'.$this->Error.'<br />'.$Query.'</div>'); 68 } 64 69 return($Result); 65 70 }
Note:
See TracChangeset
for help on using the changeset viewer.