Results 1 to 1 of 1
  1. #1
    Join Date
    Mar 2011

    Unanswered: No Tuples available in result


    I have PHP sample code which will fetch the data from the MYSQL database through ODBC driver on Linux(CentOS) machine.

    I have created DSN and same able to connect through following command isql -v But when i try to same DSN through PHP code i am getting "No tuples available at this result index" due to which unable to read the data from database through PHP APACHE configuration.

    If anyone provides the solution,It will more helpful for me to proceed further.

    Below are my sample code and other details,Please correct if anything wrong on below configuration details-
    Below is sample PHP code:

    $conn = odbc_connect("DSN", "username", "password");
    $sql = 'select * from tablename';
    $rs = odbc_exec($conn,$sql);
    echo "User Name";
    while(odbc_fetch_row($rs)) {
    $user = odbc_result($rs,"fieldname");
    echo "$user";


    Below is odbc.ini file:

    Description = MySQL ODBC Database
    TraceFile = /tmp/odbcerr.log
    SERVER =
    PORT = 3306
    USER = username
    PASSWORD = password
    DATABASE = database
    OPTION = 3
    SOCKET = /var/lib/mysql/mysql.sock

    Below is odbcinst.ini file:

    Description = ODBC for MySQL
    Driver = /usr/lib/
    Setup = /usr/lib/
    FileUsage = 1
    UsageCount = 3
    Last edited by ManjunathKCS; 03-14-11 at 07:24. Reason: Updated

Tags for this Thread

Posting Permissions

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