Oracle/PHP unable to read VARCHAR2 from result buffer
| From: | Peter Schupp | Date: | Fri, 24 Nov 2000 11:58:54 +0000 |
| Subject: | Oracle/PHP unable to read VARCHAR2 from result buffer | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-26945@lists.php.net to get a copy of this message | ||
Hi out there,
I use OCI-calls from PHP 3.0.12 with Oracle 8.0.5. Everything works fine
(logon, select, ...) but it seems that I get UniCode-VARCHAR2 back from
my result buffer which I'm not able to use directly.
strlen(OCIResult($qstr, "surname")); --- shows double (!!!)
the size of the containing string
print "surname: " . OCIResult($qstr, "surname") --- doesn't
print out anything
When I copy OCIResult($qstr, "surname") to a string variable and access
stringvar[1], ..[3], ... and so on I get my chars one after another,
[0], [2], and so on are "0" (e.g. "PETER" is "\0P\0E\0T\0E\0R").
Numbers work fine!!!
I expect NLS, UniCode ore any other Environmentals to be the problem.
Does anybody have an concrete solution on that...
Thanks for any help.
Peter
--
_______________________________________________________________________
mailto:Peter.Schupp@object-it.de
Privat:
STZ object-IT Tel. 0711 18 39 78 6 | Kirchheimer Str. 18
Postfach 10 43 62 Fax 0711 18 39 68 7 | 73760 Ostfildern-Ruit
D-70038 Stuttgart D2 0172 9 06 71 62 | Tel 0711 44 16 06 5
PGP Key available at: http://wwwkeys.de.pgp.net
_______________________________________________________________________