Newbie? - help inserting into firebird1.0
| From: | jon-david schlough | Date: | Tue, 26 Mar 2002 16:16:00 +0000 |
| Subject: | Newbie? - help inserting into firebird1.0 | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-17925@lists.php.net to get a copy of this message | ||
hi.
i'm running: php4, firebird 1.0, and IIS all on win2k.
i'm just getting started with php and firebird, so please forgive me if the
error is obvious. i hunted around for examples, the best of which i've found
btw is at http://www.ibphoenix.com/ibp_howto1.html -
thought i did this
right, i have no trouble selecting from the database but inserting is giving
me some grief...
my table:
RECREATE TABLE BUGS
(
BUG_ID INTEGER NOT NULL,
APP VARCHAR( 25) CHARACTER SET NONE COLLATE
NONE,
APP_VERSION DECIMAL( 3, 2),
BUILD VARCHAR( 5) CHARACTER SET NONE COLLATE
NONE,
OS VARCHAR( 25) CHARACTER SET NONE COLLATE
NONE,
SEVERITY VARCHAR( 25) CHARACTER SET NONE COLLATE
NONE,
BUG_PRIORITY VARCHAR( 5) CHARACTER SET NONE COLLATE
NONE,
BUG_STATE VARCHAR( 10) CHARACTER SET NONE COLLATE
NONE,
SB_USER VARCHAR( 25) CHARACTER SET NONE COLLATE
NONE,
STEPS VARCHAR( 500) CHARACTER SET NONE COLLATE
NONE,
EXPECTED VARCHAR( 500) CHARACTER SET NONE COLLATE
NONE,
OBSERVED VARCHAR( 500) CHARACTER SET NONE COLLATE
NONE,
OPENED DATE,
CLOSED DATE,
HYPOTHESIS VARCHAR( 500) CHARACTER SET NONE COLLATE
NONE,
SOLUTION VARCHAR( 500) CHARACTER SET NONE COLLATE
NONE,
STATUS VARCHAR( 15) CHARACTER SET NONE COLLATE
NONE
)
and then the add_issue.php
<?
$conn=ibase_connect ("ipaddress:c:\\Firebird\\data\\slugBug.gdb", "SYSDBA",
"XXXX");
if (!$conn) {
echo "Acess Denied!<br>";
exit;
}
$query="insert into BUGS (APP, APP_VERSION, BUILD, OS, SEVERITY,
BUG_PRIORITY, BUG_STATE, SB_USER, STEPS, EXPECTED, OBSERVED, STATUS,
OPENED)
values ("$txtApp","$numVersion","$txtBuild","$txtOs",
"$frmSeverity",
"$numPriority", "$txtState", "$txtUser", "$txtSteps",
"$txtExpected",
"$txtObserved", "$frmStatus", "NOW");";
$result=ibase_query($conn,$query);
if (!$result) {
echo "Error. Can't insert the record with the query: $query! $back";
exit;
}
echo "Record saved. $back";
ibase_close($conn);
?>
finally, the error message:
Warning: InterBase: Dynamic SQL Error SQL error code = -104 Token unknown -
line 3, char 47 , in C:\Inetpub\dev_root\slugbug\issue_send2.php on line 18
Error. Can't insert the record with the query: insert into BUGS (APP,
APP_VERSION, BUILD, OS, SEVERITY, BUG_PRIORITY, BUG_STATE, SB_USER, STEPS,
EXPECTED, OBSERVED, STATUS, OPENED) values (games/software,1.0,rc1,win2000,
, 5, , jds, [PHP-DB][PHP-DB][PHP-DB][PHP-DB],
[PHP-DB][PHP-DB][PHP-DB][PHP-DB],
[PHP-DB][PHP-DB][PHP-DB][PHP-DB][PHP-DB][PHP-DB][PHP-DB]', , NOW);!
---do i need to do some string conversion here? or the INSERT statement
wrong? a combination of the two? i'm currently RingTFM, but any help would
be greatly appreciated.
TIA!
jon-david