ID: 34784 Comment by: arn_schw at yahoo dot com Reported By: jwall at webpeak dot com Status: Assigned Bug Type: MSSQL related Operating System: Windows XP PHP Version: 5CVS-2005-10-08 (snap) Assigned To: fmk New Comment:
Hi , I've written this code to use the data stored in the data-base named moviesite. The result is supposed to print the names of three different movies each one time.But,I get each 51 times I couldn't get where the error is present.So,please help me in rectifying my mistake...... <?php //connecting to mysql $connect = mysql_connect ( "localhost" , "root" , "") or die ( " You can't be connected to the server " ) ; mysql_select_db (moviesite) ; $result = "SELECT movie_name , movie_year " . "FROM movie " . "WHERE movie_year > 1900 " . "ORDER BY movie_name " ; $res = mysql_query ( $result ) or die ( mysql_error ( ) ) ; $st = 0 ; while( $ress = mysql_fetch_assoc ( $res ) ) { extract ( $ress ) ; echo "$movie_name" ; echo "<br>" ; $st = $st+1 ; } echo "Finally the number of times it is printed is....".$st ; ?> Previous Comments: ------------------------------------------------------------------------ [2007-09-05 17:18:22] php at blazemonger dot com I am seeing this error on *every* MSSQL query under PHP 5.2.2, on Windows 2003 Server x64, in the apache 2.2.4 error log file. ------------------------------------------------------------------------ [2007-07-03 23:39:38] vollmer at ampache dot org I'm running into this same issue with large result sets. I am running a Debian ETCH server with Apache2/PHP5.2 dpkg --list | grep "php" ii libapache2-mod-php5 5.2.0-8+etch4 server-side, HTML-embedded scripting languag ii php-pear 5.2.0-8+etch4 PEAR - PHP Extension and Application Reposit ii php5-cli 5.2.0-8+etch4 command-line interpreter for the php5 script ii php5-common 5.2.0-8+etch4 Common files for packages built from the php ii php5-curl 5.2.0-8+etch4 CURL module for php5 ii php5-gd 5.2.0-8+etch4 GD module for php5 ii php5-ldap 5.2.0-8+etch4 LDAP module for php5 ii php5-mcrypt 5.2.0-8+etch4 MCrypt module for php5 ii php5-mysql 5.2.0-8+etch4 MySQL module for php5 ii php5-snmp 5.2.0-8+etch4 SNMP module for php5 ii php5-sybase 5.2.0-8+etch4 Sybase / MS SQL Server module for php5 The exact error I am seeing is Query: SELECT * FROM L_U_t_State WHERE Status='1' (51 Rows returned) Error: Changed database context to 'RMS'. Complexity or speed of query doesn't appear to matter, my larger multi-table selects/joins/unions do not produce the same error. PHP Code that is producing the error message <?php /* Run the query*/ $result = mssql_fetch_assoc($result_resource); if (!$result) { debug_event('num_rows','Failed: ' . $sql . mssql_get_last_message(),'1'); } ?> -Karl Vollmer ------------------------------------------------------------------------ [2006-08-07 20:25:47] haunw at spcollege dot edu I have this same issue on PHP 4.3.11(running as CGI) on Windows2000 server. Happens intermittently. Only pattern seems to be that it is when SQL Server is running a bit slower. ------------------------------------------------------------------------ [2006-06-16 14:14:51] hectorjazz at hotmail dot com Corrected ------------------------------------------------------------------------ [2006-06-16 14:13:21] hectprjazz at hotmail dot com extension of PHP 4.4.x (mssql.dll) = SQL Server 2000 extension of PHP 4.3.x (mssql.dll) = SQL Server 7 ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/34784 -- Edit this bug report at http://bugs.php.net/?id=34784&edit=1