ID: 35839 Updated by: [EMAIL PROTECTED] Reported By: muratyaman at gmail dot com -Status: Open +Status: Feedback Bug Type: MSSQL related Operating System: Win XP Pro SP2 PHP Version: 5CVS-2005-12-29 (snap) New Comment:
Does using php_dblib.dll work any better or not? Previous Comments: ------------------------------------------------------------------------ [2005-12-29 17:36:44] muratyaman at gmail dot com Hi! I installed latest version of PHP (5.1.2rc2) but same :( I found out that even the simplest of my pages have same problem regardless of combobox. My db abstraction layer is really simple: I just replaced "mssql_abc" functions with "db_abc" functions. I will try the DLL you recommended. I think I need to find out when/how/why the connection is broken if that's the case.. Unfortunately, there are not many traces, I looked at Apache log, SQL server log.. nothing. I do not have anything apart from PHP errors, because mssql_get_last_message() does not contain anything. Regards.. ------------------------------------------------------------------------ [2005-12-29 16:53:51] [EMAIL PROTECTED] Can you reproduce the error with out the DB abstraction layer you are using? The data send to the server contains garbage, and this could be an indication that you are getting this error in a multithreaded environment. The standard MSSQL extension is not thread safe du to the msdblib library used to build the extension. You could replace php_mssql.dll with php_dblib.dll. It provides the same functions but uses FreeTDS to create conenctions. ------------------------------------------------------------------------ [2005-12-29 16:33:49] muratyaman at gmail dot com Description: ------------ Error message is: "mssql_query() [function.mssql-query]: Possible network error: Bad token from SQL Server: Datastream processing out of sync. (severity 9) in file ... line ..." I have a WinXP, Apache2, PHP5, MSDE2000 app and many pages inserting, updating, deleting records.. Pages for inserts include code to return on error and not lose entered data. Reproduce code: --------------- (Every page opens connection, queries database multiple times, closes the connection.) Create a form with a few textboxes and a combobox. I create a combobox with: <? $selected_option = 0; echo db_combo('field1', 'select field1 from tbl1', $selected_option); ?> db_combo simply uses mssql_query to select records from a table, fill with options, create HTML code of a combobox with <select> <option></option> </select> I use a global $dbh to handle database connection, also use mssql_connect, mssql_select_db functions. Expected result: ---------------- 1. load page: tbl2_new.php combobox FULL with records read from the table 2. post to : tbl2_insert.php may not insert record because of normal reasons 3. return to: tbl2_new.php any entered data is post back combobox FULL with records read from the table 4. post to : tbl2_insert.php insert record Actual result: -------------- 1. load page: tbl2_new.php with EMPTY combobox and ERROR connection is lost every call afterwards to mssql_query fails 2. post to : tbl2_insert.php may or may not insert record 3. return to: tbl2_new.php any entered data is post back combobox FULL with records read from the table no problem at all Briefly, "new" and "edit" pages are very much similar with comboboxes etc. But on "new" pages, combobox cannot get any records on 1st run. I could not figure out the problem. But I think there is a communication problem when SQL server tries to send the records from a table. Thanks in advance. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=35839&edit=1