Changeset 861 for trunk/Packages/Common
- Timestamp:
- Oct 2, 2019, 12:15:16 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/Database.php
r858 r861 96 96 //echo('a'.$this->ShowSQLQuery.'<'.$QueryStartTime.', '.microtime_float()); 97 97 if(($this->ShowSQLQuery == true) or ($this->LogSQLQuery == true)) 98 $Duration = ' ; '.round(microtime_float() - $QueryStartTime, 4). ' s'; 99 if($this->LogSQLQuery == true) 98 { 99 $Time = round(microtime_float() - $QueryStartTime, 4); 100 $Duration = ' ; '.$Time. ' s'; 101 } 102 if(($this->LogSQLQuery == true) and ($Time != 0)) 100 103 file_put_contents($this->LogFile, $Query.$Duration."\n", FILE_APPEND); 101 104 if($this->ShowSQLQuery == true) … … 222 225 public function Transaction($Queries) 223 226 { 224 $this->PDO->beginTransaction(); 225 foreach ($Queries as $Query) 226 { 227 $Statement = $this->PDO->prepare($Query); 228 $Statement->execute(); 229 } 230 $this->PDO->commit(); 227 //echo('|'."\n"); 228 $this->PDO->beginTransaction(); 229 foreach ($Queries as $Query) 230 { 231 //echo('|'.$Query."\n"); 232 $Statement = $this->PDO->prepare($Query); 233 $Statement->execute(); 234 } 235 $this->PDO->commit(); 231 236 } 232 237 }
Note:
See TracChangeset
for help on using the changeset viewer.