cvs: php4 /ext/fbsql php_fbsql.c

From: Date: Thu, 12 Jul 2001 22:43:25 +0000
Subject: cvs: php4 /ext/fbsql php_fbsql.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-6199@lists.php.net to get a copy of this message
fmk Thu Jul 12 18:43:25 2001 EDT Modified files: /php4/ext/fbsql php_fbsql.c Log: Fixing bug when using select unique from <table> The value was not returned to the script Index: php4/ext/fbsql/php_fbsql.c diff -u php4/ext/fbsql/php_fbsql.c:1.35 php4/ext/fbsql/php_fbsql.c:1.36 --- php4/ext/fbsql/php_fbsql.c:1.35 Tue Jul 10 19:39:39 2001 +++ php4/ext/fbsql/php_fbsql.c Thu Jul 12 18:43:25 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_fbsql.c,v 1.35 2001/07/10 23:39:39 fmk Exp $ */ +/* $Id: php_fbsql.c,v 1.36 2001/07/12 22:43:25 fmk Exp $ */ /* TODO: * @@ -29,9 +29,6 @@ - Connect & set session - Autoreconnect when disconnected - Comments and cleanup - - Documentation - - - Format database error messages as HTML. BUGS - Select db with no arguments @@ -1525,9 +1522,8 @@ if (!mdOk(link, meta)) { - return_value->value.lval = 0; - return_value->type = IS_BOOL; fbcmdRelease(meta); + ZVAL_BOOL(return_value, 0) } else { if (fbcmdHasMetaDataArray(meta)) { @@ -1541,18 +1537,10 @@ if ((tp[0] == 'C') || (tp[0] == 'R')) { - return_value->value.lval = 1; - return_value->type = IS_BOOL; - if (sR == 1 && md) fbcmdRelease(md); - } - else if (tp[0] == 'I' || tp[0] == 'U' || tp[0] == 'A') - { - if (tp[0] == 'I') link->insert_id = fbcmdRowIndex(md); - return_value->value.lval = 1; - return_value->type = IS_BOOL; if (sR == 1 && md) fbcmdRelease(md); + ZVAL_BOOL(return_value, 1) } - else if ((fh = fbcmdFetchHandle(md)) || (tp[0] == 'E')) + else if ((fh = fbcmdFetchHandle(md)) || tp[0] == 'E' || (tp[0] == 'U' && fh)) { result = emalloc(sizeof(PHPFBResult)); result->link = link; @@ -1573,7 +1561,6 @@ if (tp[0] != 'E') { - result->rowCount = 0x7fffffff; result->columnCount = fbcmdColumnCount(md); result->fetchHandle = fh; result->batchSize = FB_SQL_G(batchSize); @@ -1589,6 +1576,17 @@ } ZEND_REGISTER_RESOURCE(return_value, result, le_result); } + else if (tp[0] == 'I' || tp[0] == 'I') + { + if (tp[0] == 'I') link->insert_id = fbcmdRowIndex(md); + if (sR == 1 && md) fbcmdRelease(md); + ZVAL_BOOL(return_value, 1) + } + else if(tp[0] == 'A') + { + if (sR == 1 && md) fbcmdRelease(md); + ZVAL_BOOL(return_value, 1) + } if (link) link->affectedRows = fbcmdRowCount(md); } } @@ -2548,7 +2546,7 @@ } } } - result->rowIndex = result->rowIndex+1; + result->rowIndex++; result->columnIndex = 0; } /* }}} */

« previous php.cvs (#6199) next »