|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[1999-03-28 17:40 UTC] steffenmail at writeme dot com
OK, the problem seems to appear when I try to insert an empty value into a table. When I do OCIBindByName($stmt,":vorname",&$vorname, 20); and $vorname is "" then PHP says: Warning: OCIStmtExecute: ORA-01480: trailing null missing from STR bind value in /www/e-shirt.de/htdocs/bestellung4.phtml on line 80 How can I insert empty values? Or do I have to check on every value if it's empty? Thanks in advance, - Steffen PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 04:00:01 2025 UTC |
works for me -> try this code.... you should be able to insert empty columns using bound variables like shown below: <?php $conn = OCILogon("scott","tiger"); $stmt = OCIParse($conn,"insert into emp (empno, ename) ". "values (:empno,:ename) "); $data = array(1111 => "", 2222 => "Bill", 3333 => "Jim"); // "1111" has no user-name.... OCIBindByName($stmt,":empno",&$empno,10); OCIBindByName($stmt,":ename",&$ename,6); while (list($empno,$ename) = each($data)) { OCIExecute($stmt); OCIFreeStatement($stmt); OCILogoff($conn); ?>