Darklink Posted January 27, 2009 Share Posted January 27, 2009 I'm trying to build a query with fulltext using the ODBC functions. I executed the query in phpMyAdmin and made a quick side-script to test the query and they both worked absolutely fine, however when I use the query in a larger script it seems to fall and returns me an error message saying it can't find an error message: Warning: odbc_fetch_array() [function.odbc-fetch-array]: SQL error: Failed to fetch error message, SQL state HY000 in SQLGetData in C:\...\odbc.php on line 325 I cannot find this error message anywhere online. Why on god's earth is this happening when practically the same code is working on a different file. Here is the code. You could try it out for yourself, but it will work for you. $sql = "SELECT *, MATCH (f_question, f_answer) AGAINST ('established' IN BOOLEAN MODE) AS Relevance FROM tblFaq WHERE MATCH (f_question, f_answer) AGAINST ('established' IN BOOLEAN MODE) > 0 ORDER BY Relevance DESC"; $result = odbc_exec($conn, $sql); while ( $row = odbc_fetch_array($result) ) { $rows[] = $row; } It returns 2 rows successfully, but cannot put them into an array for me. When I take away the * from the fields to select it works but doesn't return the fields I want it to. Only the relevance. I just need someone to explain to me why I could be receiving such error! Thanks Quote Link to comment https://forums.phpfreaks.com/topic/142620-unknown-odbc-error-message/ Share on other sites More sharing options...
RichardRotterdam Posted January 27, 2009 Share Posted January 27, 2009 I executed the query in phpMyAdmin and made a quick side-script to test the query and they both worked absolutely fine, however when I use the query in a larger script it seems to fall and returns me an error message saying it can't find an error message: If you use phpMyAdmin why not use the mysql_* functions instead of odbc functions. That's what phpmyadmin does anyway. Or do you need to access a microsoft database? Quote Link to comment https://forums.phpfreaks.com/topic/142620-unknown-odbc-error-message/#findComment-747595 Share on other sites More sharing options...
Darklink Posted January 28, 2009 Author Share Posted January 28, 2009 I use ODBC functions because I need to access various databases and so I made myself an ODBC framework to save a lot of hassle in that area. I am using this specific query on a MySQL database however and I cannot work out why this is happening. Quote Link to comment https://forums.phpfreaks.com/topic/142620-unknown-odbc-error-message/#findComment-748520 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.