-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi php-db members,

I'm not sure if this is the right forum to say this or if this is more
of a PHP technical issue....

I have found a strange problem with the MSSQL interface.

I have a small relational database and a PHP script which populates
and queries rows across the tables.

When an integer has been plucked from a table using mssql_query() and
mssql_fetch_array() calls, subsequent use of retrieved integers (say
$id - a relation record id) causes problems in query strings. The
result of converting an int into a string is padded with a string of
null bytes, terminating the query string prematurely from MSSQL's POV
while it looks "fine and dandy" from within PHP.

consider :
         $iQry = 'UPDATE CUSTOMER SET ADDR_ID=$addr_id'.
                 'where CUST_ID=$cust_id';

Echo the query string and you see 'UPDATE CUSTOMER SET ADDR_ID=1'

Echo a hex2bin dump of the query string and you see the rest of the
query and the nulls in the middle of it after the '1'.

There is a workaround - use chop($id) and the nulls get trimmed, but
the problem is far from obvious unless the resulting query string is
dumped out with bin2hex.

- --
Cheers -- .\\arck D. Pearlstone -- Consultant Software Engineer
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ PGP Key ID: 0x929DCDA0 | www: http://www.silverstones.com      ]

 I'm not crazy, I've just been in a very bad mood for 30 years.

-----BEGIN PGP SIGNATURE-----
Version: 6.5.8ckt (build 04)
Comment: PGP Sealed for freshness

iQA/AwUBOshMpDnkJKuSnc2gEQIaBwCfUrc9FgoFHJcMwU4gFGiGuJcdoMwAnjNi
uOecfFErEvzJ8dKtK+oLe37M
=r8iu
-----END PGP SIGNATURE-----




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to