web 2.0

How to use PHP & Oracle (oci8) Display Multiple Column

How to use PHP & Oracle (oci8) Display Multiple Column This is the guideline/example scripts how to use PHP list data from Oracle Database table and display result of multiple column.

ShotDev Focus:
- PHP & Oracle database list data and multiple column.

Example

php_oracle_multiple_column.php


<html>
<head>
<title>ShotDev.Com Tutorial</title>
</head>
<body>
<?
$objConnect = oci_connect("myuser","mypassword","TCDB");
$strSQL = "SELECT * FROM GALLERY";
$objParse = oci_parse($objConnect, $strSQL);
oci_execute ($objParse,OCI_DEFAULT);
echo"<table border=\"1\"  cellspacing=\"1\" cellpadding=\"1\"><tr>";
$intRows = 0;
while($objResult = oci_fetch_array($objParse,OCI_BOTH))
{
echo "<td>";
$intRows++;
?>
<center>
<img src="shotdev/<?=$objResult["PICTURE"];?>"><br>
<?=$objResult["GALLERYNAME"];?>
<br>
</center>
<?
echo"</td>";
if(($intRows)%2==0)
{
echo"</tr>";
}
}
echo"</tr></table>";
?>
</body>
</html>
<?
oci_close($objConnect);
?>

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

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

Screenshot

PHP & Oracle (oci8) Display Multiple Column
.
.
.

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.