Wednesday, May 8, 2013

ORACLE 11G CONNECT WITH PHP ON WINDOWS




STEP-1

 CREATE DSN USING ADMINISTRATOR TOOL




<html>
<body>

<?php
$conn=odbc_connect('orcl11g','hr','hr');
if (!$conn)
  {exit("Connection Failed: " . $conn);}
$sql="SELECT * FROM test";
$rs=odbc_exec($conn,$sql);
if (!$rs)
  {exit("Error in SQL");}
echo "<table><tr>";
echo "<th>ID</th>";
echo "<th>Name</th></tr>";
while (odbc_fetch_row($rs))
  {
  $compname=odbc_result($rs,"id");
  $conname=odbc_result($rs,"name");
  echo "<tr><td>$compname</td>";
  echo "<td>$conname</td></tr>";
  }
odbc_close($conn);
echo "</table>";
?>

</body>
</html>

1 comment:

  1. 25% OFF on Oracle Apps R12 Financials Self Paced Course along with 11 Additional Add On Courses (321 Session Videos of 120 Hours Recordings). Our Top Trending Course with 1700 Enrolled Udemy Students

    Please Check https://www.oracleappstechnical.com for details

    ReplyDelete