Panchux
asked on
PHP script works from command line but not from Apache
I'm trying to query a DB2 database under an AS400 but when I run the script I get an error
The query is:
The error is:
I know the query has a non english character so I guess it is an encoding problem. I've use mb_convert_encoding function to solve it but it was a no go. I also uncoment the AddDefaultCharset On under httpd.conf and add it to the .htaccess file in /srv/www/htdocs to no avail.
The scripts works ok through command line (php /srv/www/htdocs(tipoCambio .php) and under IIS7.
Database is IBM DB2 and I access it through unixODBC.
Any ideas will be much appreciated,
Pancho
The query is:
SELECT * FROM DIVISA WHERE AÑO=11 AND MES=2 AND DIA=28
The error is:
Warning: odbc_exec(): SQL error: [unixODBC][IBM][Controlador ODBC de iSeries Access][DB2 UDB]SQL0104 - Texto de mensaje de error no disponible. El mensaje no se puede traducir satisfactoriamente., SQL state 37000 in SQLExecDirect in /srv/www/htdocs/tipoCambio.php on line 44 Error en odbc_exec
I know the query has a non english character so I guess it is an encoding problem. I've use mb_convert_encoding function to solve it but it was a no go. I also uncoment the AddDefaultCharset On under httpd.conf and add it to the .htaccess file in /srv/www/htdocs to no avail.
The scripts works ok through command line (php /srv/www/htdocs(tipoCambio
Database is IBM DB2 and I access it through unixODBC.
Any ideas will be much appreciated,
Pancho
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
A logical view was the only solution presented that really worked.
Thanks and regards, ~Ray