Creating a ODBC variable
| From: | Liris Muller | Date: | Tue, 11 Sep 2001 11:32:47 +0000 |
| Subject: | Creating a ODBC variable | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-12338@lists.php.net to get a copy of this message | ||
Hi,
I creat the Table (DB2 - sql statment):
create table tb_proj (codproj char(12) not null,result long varchar, finali
long varchar,primary key (codproj)) in tp_dbsp1
Insert in DB2 (ODBC) in Php:
================================================
$query = "insert into tb_proj
values('$cod','$res','$fin')";
if (!($result = odbc_Exec($conn, $query))){
print("Mensagem:".odbc_errormsg());
================================================
I allways have the same message: Invalid SQL Command...
Solution : creat a host variable in PHP.
Solution - Oracle:
================================================
$sql = "INSERT INTO tb_proj (codproj,result,finali) VALUES
('$cod',:resu,:fina);";
$stmt = OCIParse($conn, $sql);
OCIBindByName($stmt,":resu",$res,100);
OCIBindByName($stmt,":fina",$fin,100);
OCIExecute($stmt, OCI_DEFAULT);
================================================
Solution - ODBC ????????
can anybody help me???
thanks
Liris