[Phplib-commit] CVS: php-lib/php/db/mysql db_sql.inc,1.10,1.11
Brought to you by:
nhruby,
richardarcher
From: Guillaume D. <gde...@us...> - 2001-09-03 10:12:28
|
Update of /cvsroot/phplib/php-lib/php/db/mysql In directory usw-pr-cvs1:/tmp/cvs-serv8855 Modified Files: db_sql.inc Log Message: Add the function check_error() to "normalize" the code Index: db_sql.inc =================================================================== RCS file: /cvsroot/phplib/php-lib/php/db/mysql/db_sql.inc,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** db_sql.inc 2001/09/01 06:52:30 1.10 --- db_sql.inc 2001/09/03 10:12:25 1.11 *************** *** 116,122 **** $this->Query_ID = @mysql_query($Query_String,$this->Link_ID); $this->Row = 0; ! $this->Errno = mysql_errno(); ! $this->Error = mysql_error(); ! if (!$this->Query_ID) { $this->halt("Invalid SQL: ".$Query_String); --- 116,120 ---- $this->Query_ID = @mysql_query($Query_String,$this->Link_ID); $this->Row = 0; ! $this->check_error(); if (!$this->Query_ID) { $this->halt("Invalid SQL: ".$Query_String); *************** *** 136,141 **** $this->Record = @mysql_fetch_array($this->Query_ID); $this->Row += 1; ! $this->Errno = mysql_errno(); ! $this->Error = mysql_error(); $stat = is_array($this->Record); --- 134,138 ---- $this->Record = @mysql_fetch_array($this->Query_ID); $this->Row += 1; ! $this->check_error(); $stat = is_array($this->Record); *************** *** 409,412 **** --- 406,414 ---- /* private: error handling */ + function check_error() { + $this->Error = @mysql_error(); + $this->Errno = @mysql_errno(); + } + function halt($msg) { $this->Error = @mysql_error($this->Link_ID); |