[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

Hi,

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=192.168.1.100;DATABASE=teszt 
ca';
$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>";

odbc_close($connect);

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; 

Thanks,

Benkó Tamás

MÁV INFORMATIKA Kft.
PKI Üzleti Egység
Számítástechnikai Rendszermérnök

benko at mavinformatika.hu
+36-1-457-94-12
+36-30-257-46-61
_______________________________________________
FreeTDS mailing list
FreeTDS at lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds


More information about the FreeTDS mailing list