Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2003
    Posts
    4

    Unanswered: 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

  2. #2
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •