Query data from AS400
Posted: Wed Feb 11, 2009 10:16 am
Hi All,
I want to use PHP to query AS400 data. I searched some articles. They all suggested using php-ODBC.
I wrote this code test:
I got error message:
Fatal error: Call to undefined function: odbc_connect() in /opt/lampp/logicreate/services/mos/templates/admin.html on line 13
I searched this error message. http://www.easysoft.com/developer/langu ... _odbc.html
It said to installed php-odbc-4.2.2-17.i386.rpm from RedHat. (But I have SLES 9)
I have - Apache 2.2.9, - PHP 4.4.9
When I try to install
I want to use PHP to query AS400 data. I searched some articles. They all suggested using php-ODBC.
I wrote this code test:
Code: Select all
<?php
$server="172.16.10.X"; #the name of the iSeries
$user="XXXX"; #a valid username that will connect to the DB
$pass="XXXX"; #a password for the username
#Connect to the Database with ODBC - $conn is defined and loaded using the "odbc_connect" PHP #directive.
$conn=odbc_connect("$server,$user,$pass"); #you may have to remove quotes
#Check Connection
if ($conn == false) {
echo "Not able to connect to database...<br>";
}
#Query the Database into a result set -
$result=odbc_exec($conn,"SELECT * from library.file where somefield=a value");
#...do other stuff here...
#don't forget to close the connection when you're done
odbc_close($conn);
?>
Fatal error: Call to undefined function: odbc_connect() in /opt/lampp/logicreate/services/mos/templates/admin.html on line 13
I searched this error message. http://www.easysoft.com/developer/langu ... _odbc.html
It said to installed php-odbc-4.2.2-17.i386.rpm from RedHat. (But I have SLES 9)
I have - Apache 2.2.9, - PHP 4.4.9
When I try to install
Code: Select all
rpm -i php-odbc-4.2.2-17.i386.rpm
[/quote]
It said: Failed dependencies:
php = 4.2.2-17 is needed by php-odbc-4.2.2-17
Please help me and let me know if I am in right direction.
Thanks in advance.
Lisa