3
I’m in a project using PHP and Oracle. the connection is OK, with this code I can run all the selects I need normally, what I can’t run are INSERTS
, UPDATES
and DELETE
.
Would anyone know why?
<?php
require_once('connection.php');
if($conn)
{
$Query = "UPDATE PQAQ SET CAMINHO_ARQUIVO = 'PDF' WHERE CODIGO_PROCESSO = 18 AND CAMINHO_ARQUIVO = 'TESTE.PHP'";
odbc_exec($conn, $Query);
}
?>
Still can’t communicate with the database :( is there a way to know if the Query was executed by ODBC? Something like an Odbc_result? something like.
– Rafael Brito
@Rafaelbrito
odbc_commit()
returns error or false?– rray
I added Odbc_commit() below my code only, it did not return at all.
– Rafael Brito
@Rafaelbrito does there
if(odbc_commit($conn)){ echo 'sucesso'; }else { print_r(odbc_errormsg($conn));}
– rray
It returns 'success', but the database does not update. I reviewed the table, the syntax, in Oracle Development the syntax is performs normally. What else could it be?
– Rafael Brito
@Rafaelbrito Before the first if put
odbc_autocommit($conn, true);
now you must save the change to the bank.– rray
Odbc_exec($Conn, $Query), after the changes you have indicated to me, is locking the PHP page. It is not enough to generate the 'success' anymore'.
– Rafael Brito
I did all the tests, Odbc_exec, when you pass a database syntax, it hangs the PHP page. I take a comma from $Query, and it runs normally. What causes Odbc_exec to crash?
– Rafael Brito
@Rafaelbrito I’ll take a look here. Out of curiosity the extension of oracle pq vc does not use in place of odbc?
– rray
It was internal problem of the same server, ran straight what you indicated me. Thank you very much.
– Rafael Brito