someguy321 Posted November 4, 2010 Share Posted November 4, 2010 I'm able to use PHP-ODBC to read the tables in an MDB file, as well as the column names on the tables. But when I try to read data from a particular table, it fails (I don't get an error, instead the browser pops up a message asking if I want to save the file "mdbtest.php" which is 0 bytes in size)! Any idea what's wrong? //THIS WORKS $conn = odbc_connect( 'TestDB', '', '' ); if ( !$conn) exit("Connection Failed: " . $conn); //STILL FINE HERE $sql = 'SELECT * FROM Customers'; //INCLUDING THIS LINE OF CODE CAUSES THE PROBLEM $rs = odbc_exec( $conn, $sql ); Link to comment https://forums.phpfreaks.com/topic/217782-php-odbc-keeps-failing-when-i-try-to-execute-select-statement/ Share on other sites More sharing options...
MasterACE14 Posted November 4, 2010 Share Posted November 4, 2010 I'm not familiar with ODBC, but is this perhaps backwards? $rs = odbc_exec( $conn, $sql ); should be... ? $rs = odbc_exec( $sql, $conn ); Link to comment https://forums.phpfreaks.com/topic/217782-php-odbc-keeps-failing-when-i-try-to-execute-select-statement/#findComment-1130415 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.