• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

PHP Oracle8i connection and query error

larva

Member
Hi guys,

I use below code to connect to Oracle8i DB with PHP
<?php
$conn= ora_plogon("yourlogin@server", "yourpassword") or die;
$cursor = ora_open($conn);
ora_commitoff($conn);

$qsvGetEmployees = "SELECT employee_id_no from employee";
$iStatement = @OCIParse($conn, $qsvGetEmployees);
@OCIExecute($iStatement, OCI_DEFAULT);
// check our query
$arrError = OCIError($iStatement);
if ($arrError['code'])
{
print $arrError['message'];
exit;
}
?>
<table border="1" width="600">
<tr>
<td>ID</td>
<td>FIRST NAME</td>
</tr>
<?php
while (OCIFetchInto($iStatement, &$arrEmployee, OCI_ASSOC+OCI_RETURN_NULLS))
{
?>
<tr>
<td><?= $arrEmployee['EMPLOYEE_ID_NO'] ?></td>
</tr>
<? }?>
</table>

But nothing display.

When I change to below :

$query = "SELECT * FROM [table name]";
ora_parse($cursor, $query) or die; // parse the SQL statement
ora_exec($cursor); // execute the parsed SQL statement
ora_fetch($cursor); // fetch a row of data

Warning: Ora_Fetch failed (ORA-01861: literal does not match format string -- while processing OCI function OFETCH/OFEN)

The above warning message display.

Please help ! Thanks

Larva



























































 
Back
Top