[PHP-DEV] PHP 4.0 Bug #7301: Error in msql_result: reproducible From: afan.remove_this_spamguard <email protected>
Date: 10/17/00

From: afan.remove_this_spamguard <email protected>
Operating system: RedHat Linux 6.1
PHP version: 4.0.3pl1
PHP Bug Type: mSQL related
Bug description: Error in msql_result: reproducible

A piece of code worked perfectly with PHP3/Apache1.3.9/msql-2..11

I tried it with PHP4/Apache_1.3.14/msql-2.0.11 and got
sporadic crashes - I found out that:
IF
  a) You have an msql database with a value in a row blank,
     e.g. ('asdf',1,'',,...)
AND
  b) you have a SELECT * statement
     $sql="SELECT * from table where ... ORDER BY ..."
     $result = msql($DB,$sql)
     while ($row = msql_fetch_row($result) ) {
        ....
     }
AND
  c) the FIRST row returned contains a value that is blank
THEN
  when php hits the msql_fetch_row($result) line,
  PHP returns nothing and gives an error in the log
file like:
  child pid 9346 exit signal Segmentation Fault

HOWEVER, if the first row returned does not have a
blank element in the row, then it seems to work ok.

----
I tried variations with 
msql_result(), msql_connect, and msql_pconnect as well
but all gave me the same problem.
-----
Relevent facts?: 
In running "make" I get 
 gcc .... -I/usr/local/Hughes/include .... -c php_msql.c -fPIC -DPIC -o php_msql.lo
 php_msql.c:189 warning: int format, long int (arg 4)
 php_msql.c:191 warning: int format, long int (arg 4)
 php_msql.c:196 warning: int format, long int (arg 4)
 php_msql.c:198 warning: int format, long int (arg 4)

I used the stock php.ini.dist file

Thanks in advance - PHP is great!

Afan Ottenheimer

-- Edit Bug report at: http://bugs.php.net/?id=7301&edit=1

-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>