[freetds] php problem

Thomas, Christopher (LLU) cwthomas at llu.edu
Thu Sep 28 16:24:14 EDT 2006

It has been my experience that when doing select queries with odbc or the mssql php api, you have to free the results before you can execute another query.

-----Original Message-----
From: freetds-bounces at lists.ibiblio.org [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of Tamás Benkó
Sent: Thursday, September 28, 2006 2:43 AM
To: FreeTDS at lists.ibiblio.org
Subject: [freetds] php problem


i try to migrate a web page from windows to linux, and I get trouble.

My problem is the folloing script:

$connection_string = 'DRIVER={FreeTDS};SERVER=;DATABASE=teszt 
$connect = odbc_connect($connection_string, "user", "userpwd"); 

$query = "SELECT * FROM causer"; 

echo "Befor executing the 1.<br />";
$result1 = odbc_exec($connect, $query); 
echo "After executing the 1.<br />";
$result2 = odbc_exec($connect, $query); 
echo "After executing the 2.<br />";

echo "result1: " . $result1 . "<br>";
echo "result2: " . $result2 . "<br>";


The first odbc_exec is ok, but at the second I get the folloing error: 
Warning: odbc_exec(): SQL error: l†Õ , SQL state 00000 in SQLExecDirect 
in /var/www/conn.php on line 10 

I use apache 1.3; unixodbc: 2.2.4-11; freetds-dev 0.61-6.2; 


Benkó Tamás

PKI Üzleti Egység
Számítástechnikai Rendszermérnök

benko at mavinformatika.hu
FreeTDS mailing list
FreeTDS at lists.ibiblio.org

More information about the FreeTDS mailing list