Bug #2300: Can't select STRING (VARCHAR) values from the Oracle DB
| From: | admin at polad dot ru | Date: | Wed, 15 Sep 1999 04:00:44 +0000 |
| Subject: | Bug #2300: Can't select STRING (VARCHAR) values from the Oracle DB | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-10918@lists.php.net to get a copy of this message | ||
From: admin@polad.ru
Operating system: RedHat Linux 5.0 (kernel 2.0.38)
PHP version: 3.0.12
PHP Bug Type: Oracle related
Bug description: Can't select STRING (VARCHAR) values from the Oracle DB
OCIResult normaly gets the number and date values but it doesn't get varchar values.
$conn = OCILogon("polad_sys", "polad_sys", "POLAD5-TCP.world");
$sql = "select * from test";
$stat = OCIParse($conn, $sql);
OCIExecute($stat, OCI_DEFAULT);
while (OCIFetch($stat)) {
$ncols = OCINumCols($stat);
for ( $i = 1; $i <= $ncols; $i++ ) {
$result = OCIResult($stat, $i); /* !!!! */
print $result; /* using $result[1] I get the first char of the string */
echo "<BR>";
}
echo "</TR>";
}
OCIFreeStatement($stat);
OCILogoff($conn);