|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-05-04 03:54 UTC] ajmer dot phull at aah dot co dot uk
SERVER: IBM AIX v4.3.3
PHP v4.0.4pl1
APACHE v1.3.19
Oracle 8i Enterprise release 8.1.7.0.0
CLIENT: DELL Intel P2
Windows NT 4.0 SP6.0a
I have created a function to update fields on the database using textboxes.
The sql statement contains parameters that obviously require binding.
I have succussfully updated several tables and fields, but whenever the field type is CHAR() then the update does not occur and NO errors are generated.
I have performed the following to try and narrow down the problem:
Removed every parameter from the sql statement and hardcoded values, (no need to perform a bind) and this updated succussfully.
Replaced a single parameter and performed a bind for that parameter and this updated succussfully, but only where the field being updated was NOT a CHAR()
Here is the function stripped down:
function Save_Details($conn)
{
$sql=" update staticdata2 set
description = :td
where tableref2 = :tr
and upper(tablecode2) = :tc ";
if (!($qry = @OCIParse($conn, $sql)))
{
$err = OCIError($conn);
OCILogoff($conn);
$m_msg="<span class=error>" . __LINE__ . ": Error " . $err["message"] . ".</span>";
return;
}
echo("<!-- $code $description $tableref -->\n");
OCIBindByName($qry, ":tc", &$code, 3);
OCIBindByName($qry, ":td", &$description, 41);
OCIBindByName($qry, ":tr", &$tableref, 4);
if (!@OCIExecute($qry))
{
$err = OCIError($qry);
OCIFreeStatement($qry);
OCILogoff($conn);
$m_msg="<span class=error>" . __LINE__ . ": Error " . $err["message"] . ".</span>";
return;
}
OCIFreeStatement($qry);
}
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 15:00:01 2025 UTC |
create table test (a char); <? $db = OCILogon("scott","tiger"); $stmt = OCIParse($db,"insert into test values (:a)"); OCIBindByName($stmt,":a",$a,1); $a = "h"; OCIExecute($stmt); ?> works just great for me. make sure you don't try to load more into a field than in room for!