ID:               31152
 Updated by:       [EMAIL PROTECTED]
 Reported By:      marek at erneker dot cz
-Status:           Open
+Status:           Closed
 Bug Type:         MSSQL related
 Operating System: Debian 2.6.9
 PHP Version:      4.3.10
 New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

There was already report about this and the bug is already
fixed..please try search the bug database BEFORE you submit any
report!!!!!



Previous Comments:
------------------------------------------------------------------------

[2004-12-17 14:28:11] marek at erneker dot cz

Description:
------------
Returns of mssql_query where I run SQL: INSERT, DELETE, USE or UPDATE
command is allways FALSE. It is not depend on result SQL query. 

I tried use FreeTDS 0.62.1, 0.62.3, 0.62.4. 

Reproduce code:
---------------
$cLink = mssql_pconnect('mssql.server.com', 'user', 'password');

$qSelDb = mssql_query('use database');
echo "USE DB return: ";var_dump($qSelDb);echo "\n";

$qDelete = mssql_query('DELETE FROM a', $cLink);
echo "DELETE FROM return:";var_dump($qDelete);echo "\n";

$qSelAll = mssql_query('SELECT * FROM a', $cLink);
echo "SELECT (0 rows) return: ";var_dump($qSelAll);echo "\n";

$iInsertId = rand(1, 1000); $qInsert = mssql_query('insert into a (id)
values ('.$iInsertId.');', $cLink);
echo "INSERT return: ";var_dump($qInsert);echo "\n";

if (!$qInsert) echo "MSSQL ERROR:".mssql_get_last_message()."\n";

$qInsert = mssql_query('SELECT * FROM a');
while ($aData = mssql_fetch_assoc($qInsert)) echo "VALUE IN TABLE:
".$aData['id']."\n";

echo "inserted value: ".$iInsertId;

mssql_close($cLink);

Expected result:
----------------
/*if 'INSERT STATEMENT IS OK':*/
USE DB return: bool(true)

DELETE FROM return:bool(true)

SELECT (0 rows) return: resource(3) of type (mssql result)

INSERT return: bool(true)
VALUE IN TABLE: XYZ
inserted value: XYZ

/*if 'INSERT STATEMENT IS FALSE':*/
USE DB return: bool(true)

DELETE FROM return:bool(true)

SELECT (0 rows) return: resource(3) of type (mssql result)

INSERT return: bool(false)
MSSQL ERROR: <Some MSSQL Error>
inserted value: XYZ


Actual result:
--------------
USE DB return: bool(false)

DELETE FROM return:bool(false)

SELECT (0 rows) return: resource(3) of type (mssql result)

INSERT return: bool(false)

MSSQL ERROR:Changed database context to 'database'.
VALUE IN TABLE: 480
inserted value: 480



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=31152&edit=1

Reply via email to