there is no result

wxdqz

New Member
Hi,

I use ODBC to access to an SQLServer from a linux machine. I can do an Insert, Update or Delete but the Select doesn't give me a result.

$conn_id=odbc_connect("$dsn","$user","$password",SQL_CUR_USE_ODBC) or die("cannot connect");
$sth=odbc_prepare($conn_id,"Select * from test") or die("cannot do");
if(odbc_execute($sth))
{
while (odbc_fetch_row($sth)) {
echo odbc_result($sth, 1);
echo " ";
echo odbc_result($sth, 2);
echo "<br>\n";
}
}
else{
echo"execute failed.";
}

The result is nothing, but if I do a "Select count (*) from test" the result is 14.
Where can be the problem???
Is it the code or can it be the driver?

Greetings, Christof
 
Back
Top