If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > PHP > RE: ODBC/MySQL/PHP Problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-17-03, 04:39
joshlewis joshlewis is offline
Registered User
 
Join Date: Dec 2003
Posts: 4
RE: ODBC/MySQL/PHP Problem

I'm not sure if this is a PHP or a MySQL problem. I'm running Red Hat 9, with MySQL 4.0.16, PHP 4.2.2, nuxODBC and MyODBC3.51. When I try execure a query using odbc_exec(), I get the following error:

Warning: SQL error: [unixODBC][MySQL][ODBC 3.51 Driver][mysqld-4.0.16-standard]Option value changed to default static cursor, SQL state 01S02 in SQLExecDirect...

The code used is given below:
require_once('DB/odbc.php');
include 'DB.php';

$connection = odbc_pconnect("odbc3","newuser","pass");
$query = odbc_exec($connection,"SELECT * FROM Staff");


According to all the PHP manuals I've read odbc_exec() takes two parameters; and odbc_connect takes three (the third being optional). Therefore I don't understand the "Option value changed..." stuff.

Although the message is just a warning, it does not return a valid ODBC result resource.

I cannot seem to resolve the problem, after searching extensively.

Any help would be greatly appreciated.

Josh Lewis
Reply With Quote
  #2 (permalink)  
Old 12-18-03, 01:04
joshlewis joshlewis is offline
Registered User
 
Join Date: Dec 2003
Posts: 4
Problem with PHP/ODBC?MySQL

've just resolved my own problem; turns out that I wasn't using the correct database: the DSN uses the "test" database as default, and was of course defaulting to that database. Would be nice if the returned error would indicate something like that. Hope this saves somebody some time...

Josh Lewis
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On