odbc_exec() issue

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

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

    echo    "\r\n<BR>$id : $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);


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.

Site Timeline