Hi!
I have a simple script that connects to an Access Database by System DSN.
It works fine upto the line 5. I get an output of 1 because of this line.
I get the following errors for BOTH the next two lines i.e line 6 and 7.
Warning: Supplied argument is not a valid ODBC result resource in c:\phpdev\www\conntest\conn.php on line 12
Warning: Supplied argument is not a valid ODBC result resource in c:\phpdev\www\conntest\conn.php on line 14
The last line 8 works fine.
I am using IIS on Windows XP with PHP 4.0.6. However, I get the same error even when I run the script on Apache 1.3 with PHP 4.0.6 on windows xp.
<?
1 : $conn=odbc_connect("vg","","") or die ("Could not connect");
2 : $sql="select * from biodata";
3 : $sql_statement=odbc_prepare($conn,$sql) or die ("coun not prepare");
4 : $sql_result=odbc_execute($sql_statement) or die ("could not execute");
5 : echo $sql_result;
6 : odbc_result_all($sql_result,"border=1");
7 : odbc_free_result($sql_result);
8 : odbc_close($conn);
?>
rupesh