Well, I can't find a mistake.
$sql="SELECT * FROM test";
if ($conn_id=odbc_connect("$dsn",$user,$password))
{
if($result_id=odbc_exec($conn_id, $sql))
{
echo "executing '$sql'<br><br>";
while(odbc_fetch_row($result_id))
{
echo"hello<br>";
echo odbc_result($result_id,1);
echo odbc_result($result_id,"test2");
}
echo "freeing result<br><br>";
odbc_free_result($result_id);
}
else
{
echo "can not execute '$sql'<BR><BR>";
}
echo "closing connection $conn_id";
odbc_close($conn_id);}
else
{
echo "can not connect to DSN: $dsn<br><br>";
}
I tried this code with odbc_fetch_row and odbc_fetch_into but the result is false so there is never displayed "hello".
If I try odbc_result without odbc_fetch_row, there is nothing (false).
Is the code correct?
Thanks,
Christof