From: [EMAIL PROTECTED]
Operating system: slackware 8.0 (modified)
PHP version: 4.2.0
PHP Bug Type: MySQL related
Bug description: mysql_fetch_object returning incomplete data
This was found in an ongoing project I am upgrading from php 4.0.4pl1
code sample:
$sql='select prodId, prodNum from products';
$result = mysql_query($sql);
do {
print_r($product);
print $product->prodId ." ". $product-prodNum
} while ($product = mysql_fetch_object($result));
print_r ($product) returns:
stdClass Object ( [prodId] => [prodNum] => E-U-00-002)
stdClass Object ( [prodId] => [prodNum] => E-U-00-003)
stdClass Object ( [prodId] => [prodNum] => E-U-00-004)
the real data would be prodId => 1, prodId => 2
the same thing done with mysql_fetch_array works perfectly (exact same
sql, etc)
I tried various loops (do..while, if, while) no changes.
Tested this with php 4.1.2 and 4.2.0 w/ same errors. Works fine on
4.0.4pl1.
php configure options as follows:
'./configure' \
'--with-mysql=/usr/local' \
'--enable-track-vars' \
'--with-dbase' \
'--with-gd=/usr/local/gd-1.8.4' \
'--with-ttf' \
'--with-t1lib' \
'--with-jpeg-dir' \
'--with-png-dir' \
'--with-tiff-dir' \
'--with-apxs=/usr/local/apache/bin/apxs' \
'--with-config-file-path=/usr/local/apache/conf' \
'--with-pdflib' \
'--enable-ftp' \
'--with-zlib-dir'
I am unable to provide a backtrace (production server, sorry)
--
Edit bug report at http://bugs.php.net/?id=16923&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=16923&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=16923&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=16923&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=16923&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=16923&r=support
Expected behavior: http://bugs.php.net/fix.php?id=16923&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=16923&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=16923&r=submittedtwice