hi ...
i have some problems with linux and odbc ...
here is the code that produces the problem:
function num_row_sql($sql_string)
{
$anzahl = 0;
$connection = odbc_connect('Lison', 'sa', 'supplynet1');
$x = odbc_exec($connection, $sql_string);
while (odbc_fetch_row($x))
{
$anzahl++;
}
return $anzahl;
}
$result = odbc_exec($connection, $query);
echo num_row_sql($query)."<br>";
if i use this code... i mean if i first get $result and then echo the num_row_sql stuff i get the following error:
Warning: SQL error: , SQL state 00000 in SQLExecDirect in /usr/local/apache/htdocs/test-odbc.php on line 26
Warning: odbc_fetch_row(): supplied argument is not a valid ODBC result resource in /usr/local/apache/htdocs/test-odbc.php on line 28
but if change the order of the code to this:
$result = odbc_exec($connection, $query);
echo num_row_sql($query)."<br>";
everything runs fine... so whats wrong with the order... i dont know the problem...
on a win2k box with iis everything runs fine.. but we need to change to linux and there is this problem...
the db is a ms sql server 7.0 ... we used php 4.2.1 with the freetds driver 0.53 .. the linux box is redhat 7.3 machine...
hope someone can help me out...
big thx and bye...
Slish (Rouven)