Bug #47803 [Opn->Fbk]: Executing prepared statements is succesfull only for the first two statements
| From: | yohgaki@php.net | Date: | Wed, 16 Jul 2014 02:41:28 +0000 |
| Subject: | Bug #47803 [Opn->Fbk]: Executing prepared statements is succesfull only for the first two statements | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-186654@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=47803&edit=1
ID: 47803
Updated by: yohgaki@php.net
Reported by: egil at wp dot pl
Summary: Executing prepared statements is succesfull only for
the first two statements
-Status: Open
+Status: Feedback
Type: Bug
Package: ODBC related
Operating System: Windows XP SP 3
PHP Version: 5.2.9
Block user comment: N
Private report: N
New Comment:
Please try using this snapshot:
http://snaps.php.net/php5.4-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
Previous Comments:
------------------------------------------------------------------------
[2009-05-29 10:18:26] tom dot graham at jadu dot co dot uk
I have exactly the same problem, two rows inserted fine and the third row is not inserted and the
following error is thrown: "[Microsoft][ODBC SQL Server Driver]Invalid character value for cast
specification".
------------------------------------------------------------------------
[2009-03-27 09:10:43] egil at wp dot pl
Description:
------------
I do odbc_prepare and then I would like to be able to execute this statement with different paramas.
This is what it is for, right? Fortunately not after 2 odbc_execute calls third call gives (mssql
2005 as you may see):
[Microsoft][SQL Native Client]Invalid character value for cast specification
Reproduce code:
---------------
<?
$sql = "UPDATE category
SET name = ?
WHERE cat_id = ?";
$result = $odbc_prepare($link, $sql);
if (!$result)
{
trigger_error ('[sql] prep: '.$sql, E_USER_ERROR);
}
foreach ($upd_cats as &$k)
{
if(!odbc_execute($result, array($k['name'], $k['id'])))
{
trigger_error ('[sql] exec: '."array({$k['name']},
{$k['id']})", E_USER_ERROR);
}
}
?>
Expected result:
----------------
successful execution (note that it works fine if I move prepare to foreach block)
Actual result:
--------------
After third execution I get an error:
[Microsoft][SQL Native Client]Invalid character value for cast specification
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=47803&edit=1