PHP und Freetds

"Christian" <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
Hello 

My Configuration
SUSE 10.3
PHP 5.2.4
Apache 2.0 Handler
Freetds 0.65 dev. 20070819-6.2

I need access to a MS SQL Server 2005 running under Windows 2003. I try it
with  freetds and unixodbc

With ISQL on the commandline I get all Value out of the Database
For Example

Code:
isql -v srvsql 'Domain\username' password
Code:
select description from job where no_='20-100'

here I get the value of the field description

When I try it with php Code

PHP CODE:
<?php 
$connect = odbc_connect("srvsql", "spirk\fic", "Zxpjr8tu"); 

if ($connect > 0) { 
print ("Connection ok\n"); 
} 
$query = "select description from job where no_='20-100'"; 

$result = odbc_exec($connect, $query); 

echo odbc_num_rows($result); 

# fetch the data from the database 
while(odbc_fetch_row($result)) { 
$field1 = odbc_result($result, 1); 
$field2 = odbc_result($result, 2); 
print("$field1 $field2\n"); 
} 

?> when I start then php script on the bash
Code:
php -q dateiname.php
I get return the following message

Code:
Connection ok
-1

The value "-1" is the result of   echo odbc_num_rows($result); 

In short words
With ISQL I get all infos that I want, with php I get the name of the
tables, but no values in the tables.

Maybe someone has a solution why it work on the commandline (isql) and fails
with PHP.


Many thanks and a happy weekend

Christian



Mit freundlichen Grüßen


Fimberger Christian

SPIRK & PARTNER
Ziviltechnikergesellschaft m.b.H.

Bayerhamerstraße 14
A-5020 Salzburg

T	+43 (0)662 64 20 12 - 239
F	+43 (0)662 64 60 12
M	+43 (0)699 16 64 20 39
e-mail:	<mailto:[email protected]>
web:	<http://www.spirk.at>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.