For Programmers: Free Programming Magazines  


Home > Archive > PHP Programming > July 2006 > odbc_exec() issue









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author odbc_exec() issue
u4yk

2006-07-31, 3:57 am

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_fetch_row($qry))
{
if(isset($check[$id]))
{
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);
}
$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.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com