web 2.0

How to use PHP & Oracle (oci8) Get Field Name

How to use PHP & Oracle (oci8) Get Field Name This is the guideline/example scripts how to use PHP get table field name from Oracle database

ShotDev Focus:
- PHP & Oracle database get field name from table.

Example

php_oracle_list_table.php


<html>
<head>
<title>ShotDev.Com Tutorial</title>
</head>
<body>
<?
$objConnect = oci_connect("myuser","mypassword","TCDB");
$strSQL = "SELECT * FROM CUSTOMER";
$objParse = oci_parse ($objConnect, $strSQL);
oci_execute ($objParse,OCI_DEFAULT);
$intNumField = oci_num_fields($objParse);
$i = 0;
echo "<b>Table CUSTOMER have $intNumField Fields.</b><br>";
for($i=1;$i<$intNumField;$i++)
{
echo $i."=".oci_field_name($objParse,$i)." (".oci_field_type($objParse,$i).")<br>";
}
oci_close($objConnect);
?>
</body>
</html>

Create a php file and save to path root-path/myphp/

Run
http://localhost/myphp/php_oracle_list_table.php

Screenshot

PHP & Oracle (oci8) Get Table Properties
.
.
.

Download this script.
Download

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars8 Stars9 Stars10 Stars (1 votes, average: 1.00 out of 10)
Loading ... Loading ...

Leave a Reply

You must be logged in to post a comment.