odbc_exec() issue

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • u4yk

    odbc_exec() issue

    I posted this on php.dev, but I'd give you guys a shot. I'm running
    PHP 5.1.1 on a Linux box, and when I try to send an MS SQL
    database via ODBC, I get the following error:
    [Mon Jul 31 02:04:29 2006] [error] [client 127.0.0.1] PHP Warning:

    odbc_exec() [<a href='function. odbc-exec'>function. odbc-exec</a>]: SQL
    error: [unixODBC][FreeTDS][SQL Server]Invalid cursor state, SQL state
    24000 in SQLExecDirect in /var/www/html/test/update.php on line 38,
    referer: http://test/test/contacts2.php

    Below is part of my code:


    while(odbc_fetc h_row($qry))
    {
    if(isset($check[$id]))
    {
    echo "\r\n<BR>$i d : $name[$id] : $email[$id] : $phone[$id] :
    $cell[$id] : $active[$id]<BR>\r\n";


    $q2 = " UPDATE Contact_Names
    SET email = '$email[$id]',
    phone = '$phone[$id]',
    cell = '$cell[$id]',
    status = '$active[$id]'
    WHERE (contactname = '$name[$id]')";
    echo "$q2<BR>\r\ n";
    $qry2 = odbc_exec($con, $q2);
    }
    $id++;



    }


    What I don't get is that it fails within PHP, but the output from the
    echo copied and pasted from SQL Server Enterprise Manager takes the
    update. Anyone have any suggestions?

    Thanks in advanced.

Working...