@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | if ($this->connectionAttempt > 1) |
| 72 | 72 | error_log("MySQLi Connection Attempt #{$this->connectionAttempt}/{$this->maxConnectErrors}"); |
| 73 | 73 | if ($this->connectionAttempt >= $this->maxConnectErrors) { |
| 74 | - $this->halt("connect($host, $user, \$password) failed. " . $mysqli->connect_error); |
|
| 74 | + $this->halt("connect($host, $user, \$password) failed. ".$mysqli->connect_error); |
|
| 75 | 75 | return 0; |
| 76 | 76 | } |
| 77 | 77 | //$this->linkId = new mysqli($host, $user, $password, $database); |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | * } |
| 88 | 88 | */ |
| 89 | 89 | if ($this->linkId->connect_errno) { |
| 90 | - $this->halt("connect($host, $user, \$password) failed. " . $mysqli->connect_error); |
|
| 90 | + $this->halt("connect($host, $user, \$password) failed. ".$mysqli->connect_error); |
|
| 91 | 91 | return 0; |
| 92 | 92 | } |
| 93 | 93 | /*if ($this->characterSet != '') { |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | $this->Errno = @mysqli_errno($this->linkId); |
| 256 | 256 | $this->Error = @mysqli_error($this->linkId); |
| 257 | 257 | if ($try == 1 && (null === $this->queryId || $this->queryId === FALSE)) { |
| 258 | - $email = "MySQLi Error<br>\n".'Query: '.$queryString . "<br>\n".'Error #'.$this->Errno.': '.$this->Error . "<br>\n".'Line: '.$line . "<br>\n".'File: '.$file . "<br>\n" . (isset($GLOBALS['tf']) ? 'User: '.$GLOBALS['tf']->session->account_id . "<br>\n" : ''); |
|
| 258 | + $email = "MySQLi Error<br>\n".'Query: '.$queryString."<br>\n".'Error #'.$this->Errno.': '.$this->Error."<br>\n".'Line: '.$line."<br>\n".'File: '.$file."<br>\n".(isset($GLOBALS['tf']) ? 'User: '.$GLOBALS['tf']->session->account_id."<br>\n" : ''); |
|
| 259 | 259 | $email .= '<br><br>Request Variables:<br>'.print_r($_REQUEST, TRUE); |
| 260 | 260 | $email .= '<br><br>Server Variables:<br>'.print_r($_SERVER, TRUE); |
| 261 | 261 | $subject = $_SERVER['HOSTNAME'].' MySQLi Error'; |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | if ($status) { |
| 323 | 323 | $this->Row = $pos; |
| 324 | 324 | } else { |
| 325 | - $this->halt("seek($pos) failed: result has " . $this->num_rows().' rows'); |
|
| 325 | + $this->halt("seek($pos) failed: result has ".$this->num_rows().' rows'); |
|
| 326 | 326 | /* half assed attempt to save the day, |
| 327 | 327 | * but do not consider this documented or even |
| 328 | 328 | * desirable behaviour. |
@@ -380,7 +380,7 @@ discard block |
||
| 380 | 380 | */ |
| 381 | 381 | public function getLastInsertId($table, $field) { |
| 382 | 382 | if (!isset($table) || $table == '' || !isset($field) || $field == '') |
| 383 | - return - 1; |
|
| 383 | + return -1; |
|
| 384 | 384 | |
| 385 | 385 | return @mysqli_insert_id($this->linkId); |
| 386 | 386 | } |
@@ -514,22 +514,22 @@ discard block |
||
| 514 | 514 | * @param int|string $field |
| 515 | 515 | * @return bool |
| 516 | 516 | */ |
| 517 | -function mysqli_result($result, $row, $field=0) { |
|
| 518 | - if ($result===false) return FALSE; |
|
| 519 | - if ($row>=mysqli_num_rows($result)) return FALSE; |
|
| 517 | +function mysqli_result($result, $row, $field = 0) { |
|
| 518 | + if ($result === false) return FALSE; |
|
| 519 | + if ($row >= mysqli_num_rows($result)) return FALSE; |
|
| 520 | 520 | if (is_string($field) && !(mb_strpos($field, '.') === FALSE)) { |
| 521 | - $tField=explode('.', $field); |
|
| 522 | - $field=-1; |
|
| 523 | - $tFields=mysqli_fetch_fields($result); |
|
| 524 | - for ($id=0, $idMax = mysqli_num_fields($result);$id<$idMax;$id++) { |
|
| 525 | - if ($tFields[$id]->table==$tField[0] && $tFields[$id]->name==$tField[1]) { |
|
| 526 | - $field=$id; |
|
| 521 | + $tField = explode('.', $field); |
|
| 522 | + $field = -1; |
|
| 523 | + $tFields = mysqli_fetch_fields($result); |
|
| 524 | + for ($id = 0, $idMax = mysqli_num_fields($result); $id < $idMax; $id++) { |
|
| 525 | + if ($tFields[$id]->table == $tField[0] && $tFields[$id]->name == $tField[1]) { |
|
| 526 | + $field = $id; |
|
| 527 | 527 | break; |
| 528 | 528 | } |
| 529 | 529 | } |
| 530 | - if ($field==-1) return FALSE; |
|
| 530 | + if ($field == -1) return FALSE; |
|
| 531 | 531 | } |
| 532 | 532 | mysqli_data_seek($result, $row); |
| 533 | - $line=mysqli_fetch_array($result); |
|
| 534 | - return isset($line[$field])?$line[$field]:false; |
|
| 533 | + $line = mysqli_fetch_array($result); |
|
| 534 | + return isset($line[$field]) ? $line[$field] : false; |
|
| 535 | 535 | } |
@@ -198,18 +198,18 @@ discard block |
||
| 198 | 198 | $this->queryId = $this->linkId->prepare($queryString); |
| 199 | 199 | $success = $this->queryId->execute(); |
| 200 | 200 | $this->Rows = $this->queryId->fetchAll(); |
| 201 | - $this->log("PDO Query $queryString (S:$success) - " . count($this->Rows).' Rows', __LINE__, __FILE__); |
|
| 201 | + $this->log("PDO Query $queryString (S:$success) - ".count($this->Rows).' Rows', __LINE__, __FILE__); |
|
| 202 | 202 | $this->Row = 0; |
| 203 | 203 | if ($success === FALSE) { |
| 204 | - $email = "MySQL Error<br>\n".'Query: '.$queryString . "<br>\n".'Error #'.print_r($this->queryId->errorInfo(), TRUE) . "<br>\n".'Line: '.$line . "<br>\n".'File: '.$file . "<br>\n" . (isset($GLOBALS['tf']) ? 'User: '.$GLOBALS['tf']->session->account_id . "<br>\n" : ''); |
|
| 204 | + $email = "MySQL Error<br>\n".'Query: '.$queryString."<br>\n".'Error #'.print_r($this->queryId->errorInfo(), TRUE)."<br>\n".'Line: '.$line."<br>\n".'File: '.$file."<br>\n".(isset($GLOBALS['tf']) ? 'User: '.$GLOBALS['tf']->session->account_id."<br>\n" : ''); |
|
| 205 | 205 | |
| 206 | 206 | $email .= '<br><br>Request Variables:<br>'; |
| 207 | 207 | foreach ($_REQUEST as $key => $value) |
| 208 | - $email .= $key.': '.$value . "<br>\n"; |
|
| 208 | + $email .= $key.': '.$value."<br>\n"; |
|
| 209 | 209 | |
| 210 | 210 | $email .= '<br><br>Server Variables:<br>'; |
| 211 | 211 | foreach ($_SERVER as $key => $value) |
| 212 | - $email .= $key.': '.$value . "<br>\n"; |
|
| 212 | + $email .= $key.': '.$value."<br>\n"; |
|
| 213 | 213 | $subject = $_SERVER['HOSTNAME'].' MySQLi Error'; |
| 214 | 214 | $headers = ''; |
| 215 | 215 | $headers .= 'MIME-Version: 1.0'.PHP_EOL; |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | if (isset($this->Rows[$pos])) { |
| 260 | 260 | $this->Row = $pos; |
| 261 | 261 | } else { |
| 262 | - $this->halt("seek($pos) failed: result has " . count($this->Rows).' rows'); |
|
| 262 | + $this->halt("seek($pos) failed: result has ".count($this->Rows).' rows'); |
|
| 263 | 263 | /* half assed attempt to save the day, |
| 264 | 264 | * but do not consider this documented or even |
| 265 | 265 | * desirable behaviour. |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | */ |
| 302 | 302 | public function getLastInsertId($table, $field) { |
| 303 | 303 | if (!isset($table) || $table == '' || !isset($field) || $field == '') |
| 304 | - return - 1; |
|
| 304 | + return -1; |
|
| 305 | 305 | return $this->linkId->lastInsertId(); |
| 306 | 306 | } |
| 307 | 307 | |
@@ -164,9 +164,9 @@ discard block |
||
| 164 | 164 | public function limit($start = 0) { |
| 165 | 165 | echo '<b>Warning: limit() is no longer used, use limitQuery()</b>'; |
| 166 | 166 | if ($start == 0) { |
| 167 | - $s = 'limit '.(int)$this->maxMatches; |
|
| 167 | + $s = 'limit '.(int) $this->maxMatches; |
|
| 168 | 168 | } else { |
| 169 | - $s = 'limit '.(int)$start.','.(int)$this->maxMatches; |
|
| 169 | + $s = 'limit '.(int) $start.','.(int) $this->maxMatches; |
|
| 170 | 170 | } |
| 171 | 171 | return $s; |
| 172 | 172 | } |
@@ -185,9 +185,9 @@ discard block |
||
| 185 | 185 | if (!$numRows) |
| 186 | 186 | $numRows = $this->maxMatches; |
| 187 | 187 | if ($offset == 0) { |
| 188 | - $queryString .= ' LIMIT '.(int)$numRows; |
|
| 188 | + $queryString .= ' LIMIT '.(int) $numRows; |
|
| 189 | 189 | } else { |
| 190 | - $queryString .= ' LIMIT '.(int)$offset.','.(int)$numRows; |
|
| 190 | + $queryString .= ' LIMIT '.(int) $offset.','.(int) $numRows; |
|
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | if ($this->Debug) |
@@ -258,26 +258,26 @@ discard block |
||
| 258 | 258 | * @return mixed|void |
| 259 | 259 | */ |
| 260 | 260 | public function logBackTrace($msg, $line = '', $file = '') { |
| 261 | - $backtrace=(function_exists('debug_backtrace') ? debug_backtrace() : []); |
|
| 261 | + $backtrace = (function_exists('debug_backtrace') ? debug_backtrace() : []); |
|
| 262 | 262 | $this->log( |
| 263 | 263 | ('' !== getenv('REQUEST_URI') ? ' '.getenv('REQUEST_URI') : ''). |
| 264 | 264 | ((isset($_POST) && count($_POST)) ? ' POST='.json_encode($_POST) : ''). |
| 265 | 265 | ((isset($_GET) && count($_GET)) ? ' GET='.json_encode($_GET) : ''). |
| 266 | 266 | ((isset($_FILES) && count($_FILES)) ? ' FILES='.json_encode($_FILES) : ''). |
| 267 | 267 | ('' !== getenv('HTTP_USER_AGENT') ? ' AGENT="'.getenv('HTTP_USER_AGENT').'"' : ''). |
| 268 | - (isset($_SERVER[ 'REQUEST_METHOD' ]) ?' METHOD="'. $_SERVER['REQUEST_METHOD']. '"'. |
|
| 269 | - ($_SERVER['REQUEST_METHOD'] === 'POST' ? ' POST="'. json_encode($_POST). '"' : '') : ''), $line, $file, 'error'); |
|
| 270 | - for($level=1, $levelMax = count($backtrace);$level < $levelMax;$level++) { |
|
| 271 | - $message=(isset($backtrace[$level]['file']) ? 'File: '. $backtrace[$level]['file'] : ''). |
|
| 272 | - (isset($backtrace[$level]['line']) ? ' Line: '. $backtrace[$level]['line'] : ''). |
|
| 273 | - ' Function: '.(isset($backtrace[$level] ['class']) ? '(class '. $backtrace[$level] ['class'].') ' : '') . |
|
| 268 | + (isset($_SERVER['REQUEST_METHOD']) ? ' METHOD="'.$_SERVER['REQUEST_METHOD'].'"'. |
|
| 269 | + ($_SERVER['REQUEST_METHOD'] === 'POST' ? ' POST="'.json_encode($_POST).'"' : '') : ''), $line, $file, 'error'); |
|
| 270 | + for ($level = 1, $levelMax = count($backtrace); $level < $levelMax; $level++) { |
|
| 271 | + $message = (isset($backtrace[$level]['file']) ? 'File: '.$backtrace[$level]['file'] : ''). |
|
| 272 | + (isset($backtrace[$level]['line']) ? ' Line: '.$backtrace[$level]['line'] : ''). |
|
| 273 | + ' Function: '.(isset($backtrace[$level] ['class']) ? '(class '.$backtrace[$level] ['class'].') ' : ''). |
|
| 274 | 274 | (isset($backtrace[$level] ['type']) ? $backtrace[$level] ['type'].' ' : ''). |
| 275 | 275 | $backtrace[$level] ['function'].'('; |
| 276 | - if(isset($backtrace[$level] ['args'])) |
|
| 277 | - for($argument = 0, $argumentMax = count($backtrace[$level]['args']); $argument < $argumentMax; $argument++) |
|
| 276 | + if (isset($backtrace[$level] ['args'])) |
|
| 277 | + for ($argument = 0, $argumentMax = count($backtrace[$level]['args']); $argument < $argumentMax; $argument++) |
|
| 278 | 278 | $message .= ($argument > 0 ? ', ' : ''). |
| 279 | 279 | (is_object($backtrace[$level]['args'][$argument]) ? 'class '.get_class($backtrace[$level]['args'][$argument]) : json_encode($backtrace[$level]['args'][$argument])); |
| 280 | - $message.=')'; |
|
| 280 | + $message .= ')'; |
|
| 281 | 281 | $this->log($message, $line, $file, 'error'); |
| 282 | 282 | } |
| 283 | 283 | } |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | $this->log("Database error: $msg", $line, $file, 'error'); |
| 293 | 293 | if ($this->Errno != '0' || !in_array($this->Error, '', '()')) { |
| 294 | 294 | $sqlstate = mysqli_sqlstate($this->linkId); |
| 295 | - $this->log("MySQLi SQLState: {$sqlstate}. Error: " . $this->Errno . ' (' . $this->Error . ')', $line, $file, 'error'); |
|
| 295 | + $this->log("MySQLi SQLState: {$sqlstate}. Error: ".$this->Errno.' ('.$this->Error.')', $line, $file, 'error'); |
|
| 296 | 296 | } |
| 297 | 297 | $this->logBackTrace($msg, $line, $file); |
| 298 | 298 | } |
@@ -36,10 +36,10 @@ discard block |
||
| 36 | 36 | public function quote($text = '', $type = 'text') { |
| 37 | 37 | switch ($type) { |
| 38 | 38 | case 'text': |
| 39 | - return "'" . mysqli_real_escape_string($this->linkId, $text) . "'"; |
|
| 39 | + return "'".mysqli_real_escape_string($this->linkId, $text)."'"; |
|
| 40 | 40 | break; |
| 41 | 41 | case 'integer': |
| 42 | - return (int)$text; |
|
| 42 | + return (int) $text; |
|
| 43 | 43 | break; |
| 44 | 44 | default: |
| 45 | 45 | return $text; |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | if ($this->connectionAttempt > 1) |
| 139 | 139 | error_log("MySQLi Connection Attempt #{$this->connectionAttempt}/{$this->maxConnectErrors}"); |
| 140 | 140 | if ($this->connectionAttempt >= $this->maxConnectErrors) { |
| 141 | - $this->halt("connect($host, $user, \$password) failed. " . $mysqli->connect_error); |
|
| 141 | + $this->halt("connect($host, $user, \$password) failed. ".$mysqli->connect_error); |
|
| 142 | 142 | return 0; |
| 143 | 143 | } |
| 144 | 144 | $this->linkId = mysqli_init(); |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | $this->linkId->real_connect($host, $user, $password, $database); |
| 147 | 147 | $this->linkId->set_charset($this->characterSet); |
| 148 | 148 | if ($this->linkId->connect_errno) { |
| 149 | - $this->halt("connect($host, $user, \$password) failed. " . $mysqli->connect_error); |
|
| 149 | + $this->halt("connect($host, $user, \$password) failed. ".$mysqli->connect_error); |
|
| 150 | 150 | return 0; |
| 151 | 151 | } |
| 152 | 152 | } |
@@ -292,8 +292,8 @@ discard block |
||
| 292 | 292 | } |
| 293 | 293 | $this->haltOnError = $haltPrev; |
| 294 | 294 | if ($this->queryId === FALSE) { |
| 295 | - $email = "MySQLi Error<br>\n".'Query: '.$queryString . "<br>\n".'Error #'.$this->Errno.': '.$this->Error . "<br>\n".'Line: '.$line . "<br>\n".'File: '.$file . "<br>\n" . (isset($GLOBALS['tf']) ? |
|
| 296 | - 'User: '.$GLOBALS['tf']->session->account_id . "<br>\n" : ''); |
|
| 295 | + $email = "MySQLi Error<br>\n".'Query: '.$queryString."<br>\n".'Error #'.$this->Errno.': '.$this->Error."<br>\n".'Line: '.$line."<br>\n".'File: '.$file."<br>\n".(isset($GLOBALS['tf']) ? |
|
| 296 | + 'User: '.$GLOBALS['tf']->session->account_id."<br>\n" : ''); |
|
| 297 | 297 | |
| 298 | 298 | $email .= '<br><br>Request Variables:<br>'.print_r($_REQUEST, TRUE); |
| 299 | 299 | $email .= '<br><br>Server Variables:<br>'.print_r($_SERVER, TRUE); |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | if ($status) { |
| 349 | 349 | $this->Row = $pos; |
| 350 | 350 | } else { |
| 351 | - $this->halt("seek($pos) failed: result has " . $this->num_rows().' rows'); |
|
| 351 | + $this->halt("seek($pos) failed: result has ".$this->num_rows().' rows'); |
|
| 352 | 352 | /* half assed attempt to save the day, |
| 353 | 353 | * but do not consider this documented or even |
| 354 | 354 | * desirable behaviour. |
@@ -398,7 +398,7 @@ discard block |
||
| 398 | 398 | */ |
| 399 | 399 | |
| 400 | 400 | if (!isset($table) || $table == '' || !isset($field) || $field == '') |
| 401 | - return - 1; |
|
| 401 | + return -1; |
|
| 402 | 402 | |
| 403 | 403 | return @mysqli_insert_id($this->linkId); |
| 404 | 404 | } |
@@ -177,16 +177,16 @@ discard block |
||
| 177 | 177 | $this->queryId = $this->linkId->Execute($queryString); |
| 178 | 178 | } |
| 179 | 179 | catch (exception $e) { |
| 180 | - $email = "MySQL Error<br>\n".'Query: '.$queryString . "<br>\n".'Error #'.print_r($e, TRUE) . "<br>\n".'Line: '.$line . "<br>\n".'File: '.$file . "<br>\n" . (isset($GLOBALS['tf']) ? |
|
| 181 | - 'User: '.$GLOBALS['tf']->session->account_id . "<br>\n" : ''); |
|
| 180 | + $email = "MySQL Error<br>\n".'Query: '.$queryString."<br>\n".'Error #'.print_r($e, TRUE)."<br>\n".'Line: '.$line."<br>\n".'File: '.$file."<br>\n".(isset($GLOBALS['tf']) ? |
|
| 181 | + 'User: '.$GLOBALS['tf']->session->account_id."<br>\n" : ''); |
|
| 182 | 182 | |
| 183 | 183 | $email .= '<br><br>Request Variables:<br>'; |
| 184 | 184 | foreach ($_REQUEST as $key => $value) |
| 185 | - $email .= $key.': '.$value . "<br>\n"; |
|
| 185 | + $email .= $key.': '.$value."<br>\n"; |
|
| 186 | 186 | |
| 187 | 187 | $email .= '<br><br>Server Variables:<br>'; |
| 188 | 188 | foreach ($_SERVER as $key => $value) |
| 189 | - $email .= $key.': '.$value . "<br>\n"; |
|
| 189 | + $email .= $key.': '.$value."<br>\n"; |
|
| 190 | 190 | $subject = $_SERVER['HOSTNAME'].' MySQLi Error'; |
| 191 | 191 | $headers = ''; |
| 192 | 192 | $headers .= 'MIME-Version: 1.0'.PHP_EOL; |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | admin_mail($subject, $email, $headers, FALSE, 'admin/sql_error.tpl'); |
| 197 | 197 | $this->halt('Invalid SQL: '.$queryString, $line, $file); |
| 198 | 198 | } |
| 199 | - $this->log("ADOdb Query $queryString (S:$success) - " . count($this->Rows).' Rows', __LINE__, __FILE__); |
|
| 199 | + $this->log("ADOdb Query $queryString (S:$success) - ".count($this->Rows).' Rows', __LINE__, __FILE__); |
|
| 200 | 200 | $this->Row = 0; |
| 201 | 201 | |
| 202 | 202 | // Will return nada if it fails. That's fine. |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | if (isset($this->Rows[$pos])) { |
| 233 | 233 | $this->Row = $pos; |
| 234 | 234 | } else { |
| 235 | - $this->halt("seek($pos) failed: result has " . count($this->Rows).' rows'); |
|
| 235 | + $this->halt("seek($pos) failed: result has ".count($this->Rows).' rows'); |
|
| 236 | 236 | /* half assed attempt to save the day, |
| 237 | 237 | * but do not consider this documented or even |
| 238 | 238 | * desirable behaviour. |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | public function haltmsg($msg, $line = '', $file = '') { |
| 375 | 375 | $this->log("Database error: $msg", $line, $file, 'error'); |
| 376 | 376 | if ($this->linkId->ErrorNo() != '0' && $this->linkId->ErrorMsg() != '') |
| 377 | - $this->log('ADOdb SQL Error: ' . $this->linkId->ErrorMsg(), $line, $file, 'error'); |
|
| 377 | + $this->log('ADOdb SQL Error: '.$this->linkId->ErrorMsg(), $line, $file, 'error'); |
|
| 378 | 378 | $this->logBackTrace($msg, $line, $file); |
| 379 | 379 | } |
| 380 | 380 | |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | */ |
| 33 | 33 | public function ifadd($add, $me) { |
| 34 | 34 | if ('' != $add) |
| 35 | - return ' '.$me . $add; |
|
| 35 | + return ' '.$me.$add; |
|
| 36 | 36 | return ''; |
| 37 | 37 | } |
| 38 | 38 | |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | */ |
| 83 | 83 | public function connect() { |
| 84 | 84 | if (0 == $this->linkId) { |
| 85 | - $connectString = 'dbname='.$this->database . $this->ifadd($this->host, 'host=') . $this->ifadd($this->port, 'port=') . $this->ifadd($this->user, 'user=') . $this->ifadd("'" . $this->password . "'", 'password='); |
|
| 85 | + $connectString = 'dbname='.$this->database.$this->ifadd($this->host, 'host=').$this->ifadd($this->port, 'port=').$this->ifadd($this->user, 'user=').$this->ifadd("'".$this->password."'", 'password='); |
|
| 86 | 86 | $this->linkId = pg_pconnect($connectString); |
| 87 | 87 | |
| 88 | 88 | if (!$this->linkId) { |
@@ -262,21 +262,21 @@ discard block |
||
| 262 | 262 | * conditional code to the apps. |
| 263 | 263 | */ |
| 264 | 264 | if (!isset($table) || $table == '' || !isset($field) || $field == '') |
| 265 | - return - 1; |
|
| 265 | + return -1; |
|
| 266 | 266 | |
| 267 | 267 | $oid = pg_getlastoid($this->queryId); |
| 268 | 268 | if ($oid == -1) |
| 269 | - return - 1; |
|
| 269 | + return -1; |
|
| 270 | 270 | |
| 271 | 271 | $result = @pg_exec($this->linkId, "select $field from $table where oid=$oid"); |
| 272 | 272 | if (!$result) |
| 273 | - return - 1; |
|
| 273 | + return -1; |
|
| 274 | 274 | |
| 275 | 275 | $Record = @pg_fetch_array($result, 0); |
| 276 | 276 | @pg_freeresult($result); |
| 277 | 277 | if (!is_array($Record)) /* OID not found? */ |
| 278 | 278 | { |
| 279 | - return - 1; |
|
| 279 | + return -1; |
|
| 280 | 280 | } |
| 281 | 281 | |
| 282 | 282 | return $Record[0]; |