You are here: odbc_exec() issue « PHP Programming Language « IT news, forums, messages
odbc_exec() issue

Posted by u4yk on 07/31/06 09:02

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.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация