Skip to Content.
Sympa Menu

freetds - Linux, PHP3, MS-SQL connection doesn't close

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Gary Hall <gary AT mcg-graphics.com>
  • To: freetds AT franklin.oit.unc.edu
  • Subject: Linux, PHP3, MS-SQL connection doesn't close
  • Date: Tue, 22 Jun 1999 09:52:38 +0100


Hi

I've installed the FreeTDS driver successfully on RedHat 5.2, with
PHP3 and Apache and am trying to connect to MS-SQL 6.5.

I can connect a few times without a problem but then after a while the
client hangs.

I am no expert with MS-SQL but by looking at the SQL trace window I
can see that none of the connections are being closed, consequently
when the maximimum number of connections is hit the client seems to
hang.

I have appended the code I have used for this below:

$cnn = sybase_connect("192.9.200.185", "name", "password");
$lnk = sybase_select_db("Backup", $cnn);
$resultset = sybase_query("SELECT Job_Description FROM Jobs WHERE
Job_Description LIKE '%$SEARCH%'", $lnk);
$results = sybase_num_rows($resultset);
if ($results)
{
echo "<font size='3' face='Verdana, Arial, Helvetica, sans-serif'>A total
of $results search results were found in the database </FONT><BR><BR>";
echo "<hr width='600' size='5'>";
for ($i=0;$i<$results;$i++)
{
$DESCR=sybase_result($resultset, $i,0);
echo "$DESCR<BR>";
}
}
else
{
echo "No Records For<strong> $results </strong>Were Found";
}
sybase_close($cnn);

I have also noticed that if there are no results to the query then the
client also hangs. This might be a mistake in my code, but I can't see
anything.

Any ideas anyone ?

Thanks

Gary





  • Linux, PHP3, MS-SQL connection doesn't close, Gary Hall, 06/22/1999

Archive powered by MHonArc 2.6.24.

Top of Page