ID: 38870
Comment by: phpbugs at thequod dot de
Reported By: howardt at calhounisd dot org
Status: Open
Bug Type: MSSQL related
Operating System: Windows XP, Windows Server 2000
PHP Version: 4.4.4
New Comment:
Try
var_dump($Insert_Result);
after executing the query (and remove the "or die()"
therefor, of course).
What does it result in?
Previous Comments:
------------------------------------------------------------------------
[2006-09-18 20:40:11] howardt at calhounisd dot org
I set the display_errors and error_reporting as directed, restarted the
service (in IIS), and I could not get an error message to display. I
also tried setting track_errors=on and then referencing $php_errormsg,
but still got nothing.
------------------------------------------------------------------------
[2006-09-18 17:54:51] [EMAIL PROTECTED]
Set display_errors to On, error_reporting to E_ALL and restart the
webserver.
Please post the error message you get after that.
------------------------------------------------------------------------
[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