Jump to content


Oracle Persistent Connection

  • Please log in to reply
No replies to this topic

#1 wesso

  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 06 September 2005 - 09:10 AM

I have recently configured php4 and Apache to works fine with Oracle 10g database on windows.

The oracle 10g does have Apache and PHP modules built in. And all work fine.

I have tried to use (ociplogon) instead of (OCILogon) and it works fine by establishing many child process connections.
But they will run for ever..

Is there any way to kill the child processes after a defined timeout or for example to kill the process that has been inactive for while.

(PS: why having many connections to the database that is not been used for while)

If there is no function in PHP to do that, can you so please help with a script code to do that.

Here is how my simple php script looks like:



$db_conn = ociplogon( "king", "camilla", "PROD" );

$cmdstr = "select FIRSTNAME, LASTNAME from person where ID BETWEEN 14106 AND 14125";

$parsed = ociparse($db_conn, $cmdstr);

$nrows = ocifetchstatement($parsed, $results);

echo "<html><head><title>Oracle PHP Test</title></head><body>";
echo "<center><h2>Oracle PHP Test</h2><br>";
echo "<table border=1 cellspacing='0' width='50%'>\n<tr>\n";
echo "<td><b>Name</b></td>\n<td><b>Salary</b></td>\n</tr>\n";

for ($i = 0; $i < $nrows; $i++ )
echo "<tr>\n";
echo "<td>" . $results["FIRSTNAME"][$i] . "</td>";
echo "<td>" . $results["LASTNAME"][$i] . "</td>";
//echo "<td>$ " . number_format($results["PERSONMASTER_ID"][$i], 2). "</td>";
echo "</tr>\n";

echo "<tr><td colspan='2'> Number of Rows: <B>$nrows</B></td></tr></table>";
echo "<br><em>Tillykke Wessam!</em><br></center></body></html>\n";




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users