0
I need to insert an image in oracle using php, but after I convert it to insert into the database, it gets some characters & in the middle of the string, this character in Oracle triggers an input screen, when this input screen is triggered, php gets lost and throws an exception, I have tried to use set define off to suppress the input screen but without success, my oracle user does not have this permission and there is no way I can get another user, what would be the way around this question? the question would be, how to delete the oracle input screen without using set define off.
This is the input screen I need to delete:
would be able to post your php code you are using to insert ?
– David
The problem is not in Insert but in sumprimir the input screen without using set define off, if I post the Insert I will end up taking the focus of the question.
– ROBERTO ALBINO JUNIOR
I also find the question strange, I would also like to see how this line being executed.
– Reginaldo Rigo
Take a test, try to insert into a column with the type
varchar2(10)
in a test table, with the value:R0b&rT0
and make sure you are entering. Using PHP, of course.– David
I’ve done this test David when I try to do that Oracle fires the input window that’s in the print up there, that’s how I discovered the error after many attempts, when php comes across this window it triggers an exception it would be almost impossible for me to make php communicate with this window in the background, I need to disable this input without using set define off
– ROBERTO ALBINO JUNIOR
I don’t know much about PHP, but I really believe that the problem is in your PHP code, using PDO? mysqli? Post your code, I believe someone can help.
– David
You can use set escape?
– Reginaldo Rigo
I can’t wear a set, unfortunately.
– ROBERTO ALBINO JUNIOR
So I’m using PDO, yes, if I was going to improve it would have to be the part of the code that turns the photo into hexadecimal,.
– ROBERTO ALBINO JUNIOR
You can use another character other than &?
– Reginaldo Rigo
I can, just because this character is in the middle of a photo transformed in hexadecimal, each string of this has some 6000 characters is invicable to each new photo do the manual search of these characters inside the string.
– ROBERTO ALBINO JUNIOR
@ROBERTOALBINOJUNIOR, I believe that your problem is specifically in the query that makes Insert. This seems to me a simple error of string escape. PDO usually escapes everything when using Preparedstatement. You are either concatenating the query or using Preparedstatements ?
– jlHertel
Concatenating the query
– ROBERTO ALBINO JUNIOR