#38870 [Opn->Fbk]: Die on INSERT command using MSSQL_Query

From: Date: Mon, 18 Sep 2006 17:54:52 +0000
Subject: #38870 [Opn->Fbk]: Die on INSERT command using MSSQL_Query
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-102357@lists.php.net to get a copy of this message
 ID:               38870
 Updated by:       tony2001@php.net
 Reported By:      howardt at calhounisd dot org
-Status:           Open
+Status:           Feedback
 Bug Type:         MSSQL related
 Operating System: Windows XP, Windows Server 2000
 PHP Version:      4.4.4
 New Comment:

Set display_errors to On, error_reporting to E_ALL and restart the
webserver.
Please post the error message you get after that.


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

[2006-09-18 17:36:45] howardt at calhounisd dot org

Description:
------------
When running an INSERT command through MSSQL_Query, the transaction is
successful (the record is inserted) but the script immediately dies
("OR die(...)" is executed).  I have followed what documentation I can
find on the PHP site, but it dies every time. This does not occur on
SELECT or UPDATE commands.

Reproduce code:
---------------
<?
$MSSQL_Link = MSSQL_Connect($DistrictServer, "UserID", "password");

MSSQL_Select_DB($DistrictServerDB, $MSSQL_Link);

$Insert_Query = "INSERT INTO table(SchoolID, StateID)
VALUES('$StudentNum', '$stateid')";

$Insert_Result = MSSQL_Query($Insert_Query, $MSSQL_Link) OR die("Could
not insert record. " . $Insert_Query);

echo "Success";
?>

Expected result:
----------------
"Success" should be displayed on the page.

Actual result:
--------------
"Could not insert record. INSERT INTO table(SchoolID, StateID)
VALUES('123456', '987654')" is displayed instead.


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


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


Thread (6 messages)

« previous php.bugs (#102357) next »