RE: [PHP] AS/400 data access

2002-04-09 Thread Collins, Robert

I am also trying to access data on an AS/400 have you gotten it to work, if
so can you send an example? Thanks in advance.
 

Robert W. Collins II 
Webmaster 
New Orleans Regional Transit Authority 
Phone : (504) 248-3826 
Email : [EMAIL PROTECTED] 

-Original Message-
From: Rance Hall [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 08, 2002 3:02 PM
To: [EMAIL PROTECTED]
Subject: [PHP] AS/400 data access


the data that I need to generate a dynamic web page with PHP is on an AS/400
server
 
if any of you have had to so this before, can you show me the connect code.
 
I'm pretty sure I'm gonna have to use unified ODBC PHP commands, but not
sure how to make the connection from the webserver to the database.
 

Rance Hall
308.238.2455
Internal Office Extensions: 2455 or 6655
PC Programmer, The Buckle, Inc.
[EMAIL PROTECTED]


 




RE: [PHP] AS/400 data access

2002-04-09 Thread Matt Schroebel

I just did this on a Linux box running Red Hat 7.2 last Friday.  I used several 
sources on the web and wrote up my exact steps and posted them at 
http://www.php-faq.com/as400.html The other sources are quoted in that document.  

Keep in mind, it's not the final version of the document, and I'd appreciate any 
feedback.  After I get my app running, I'm going to move it to a FreeBSD box and 
document that setup.  I was close to getting it to work on FreeBSD last week, but 
decided to get it working with Redhat since that's what the original docs describe.

I have written a couple of simple scripts that query the db on the AS/400 and display 
the results.  The performance seems fine. I did find that I had to explictly state the 
library name the table is in as part of the sql.  For instance:
$sql = select field1, field2 from library.table where key=$id;

If you create a collection with the same name as the user php is connecting with then 
you don't need to specify the library.  I need to read up a lot because there is a way 
to set the path to multiple
libraries such that I saw in one of the IBM SQL books which is
$query = SET path library1, library2;
But it wouldn't work for me. If either of you find the solution in the maze of IBM 
docs, let me know and I'll add it to the instructions.

Also, you can't single quote numerics like you can in MySQL.

As I said, I just got it working, and will update the document as I learn more about 
the pecularities of the AS/400.

Oh, make sure to grab the replacement odbc_fetch_array code in the user notes at 
http://www.php.net/manual/en/function.odbc-fetch-array.php

 -Original Message-
 From: Collins, Robert [mailto:[EMAIL PROTECTED]] 
 Sent: Tuesday, April 09, 2002 2:13 PM
 To: 'Rance Hall'; [EMAIL PROTECTED]
 Subject: RE: [PHP] AS/400 data access
 
 
 I am also trying to access data on an AS/400 have you gotten 
 it to work, if
 so can you send an example? Thanks in advance.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] AS/400 data access

2002-04-09 Thread Collins, Robert

Thanks. Unfortunately this project is on a windows based platform, but this
may head me in the right direction.


Robert W. Collins II 
Webmaster 
New Orleans Regional Transit Authority 
Phone : (504) 248-3826 
Email : [EMAIL PROTECTED] 



-Original Message-
From: Matt Schroebel [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 09, 2002 2:46 PM
To: 'Collins, Robert'; 'Rance Hall'; [EMAIL PROTECTED]
Subject: RE: [PHP] AS/400 data access


I just did this on a Linux box running Red Hat 7.2 last Friday.  I used
several sources on the web and wrote up my exact steps and posted them at
http://www.php-faq.com/as400.html The other sources are quoted in that
document.  

Keep in mind, it's not the final version of the document, and I'd appreciate
any feedback.  After I get my app running, I'm going to move it to a FreeBSD
box and document that setup.  I was close to getting it to work on FreeBSD
last week, but decided to get it working with Redhat since that's what the
original docs describe.

I have written a couple of simple scripts that query the db on the AS/400
and display the results.  The performance seems fine. I did find that I had
to explictly state the library name the table is in as part of the sql.  For
instance:
$sql = select field1, field2 from library.table where key=$id;

If you create a collection with the same name as the user php is connecting
with then you don't need to specify the library.  I need to read up a lot
because there is a way to set the path to multiple
libraries such that I saw in one of the IBM SQL books which is
$query = SET path library1, library2;
But it wouldn't work for me. If either of you find the solution in the maze
of IBM docs, let me know and I'll add it to the instructions.

Also, you can't single quote numerics like you can in MySQL.

As I said, I just got it working, and will update the document as I learn
more about the pecularities of the AS/400.

Oh, make sure to grab the replacement odbc_fetch_array code in the user
notes at http://www.php.net/manual/en/function.odbc-fetch-array.php

 -Original Message-
 From: Collins, Robert [mailto:[EMAIL PROTECTED]] 
 Sent: Tuesday, April 09, 2002 2:13 PM
 To: 'Rance Hall'; [EMAIL PROTECTED]
 Subject: RE: [PHP] AS/400 data access
 
 
 I am also trying to access data on an AS/400 have you gotten 
 it to work, if
 so can you send an example? Thanks in advance.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] AS/400 data access

2002-04-09 Thread Dan Vande More

Thanks Mr. Collins, I wish that would have been about 7 months ago when I did 
everything:)
I used those three articles and a couple more to get it done, but the directions look 
great.


-Original Message-
From: Collins, Robert [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 09, 2002 3:24 PM
To: 'Matt Schroebel'; Collins, Robert; 'Rance Hall';
[EMAIL PROTECTED]
Subject: RE: [PHP] AS/400 data access


Thanks. Unfortunately this project is on a windows based platform, but this
may head me in the right direction.


Robert W. Collins II 
Webmaster 
New Orleans Regional Transit Authority 
Phone : (504) 248-3826 
Email : [EMAIL PROTECTED] 



-Original Message-
From: Matt Schroebel [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 09, 2002 2:46 PM
To: 'Collins, Robert'; 'Rance Hall'; [EMAIL PROTECTED]
Subject: RE: [PHP] AS/400 data access


I just did this on a Linux box running Red Hat 7.2 last Friday.  I used
several sources on the web and wrote up my exact steps and posted them at
http://www.php-faq.com/as400.html The other sources are quoted in that
document.  

Keep in mind, it's not the final version of the document, and I'd appreciate
any feedback.  After I get my app running, I'm going to move it to a FreeBSD
box and document that setup.  I was close to getting it to work on FreeBSD
last week, but decided to get it working with Redhat since that's what the
original docs describe.

I have written a couple of simple scripts that query the db on the AS/400
and display the results.  The performance seems fine. I did find that I had
to explictly state the library name the table is in as part of the sql.  For
instance:
$sql = select field1, field2 from library.table where key=$id;

If you create a collection with the same name as the user php is connecting
with then you don't need to specify the library.  I need to read up a lot
because there is a way to set the path to multiple
libraries such that I saw in one of the IBM SQL books which is
$query = SET path library1, library2;
But it wouldn't work for me. If either of you find the solution in the maze
of IBM docs, let me know and I'll add it to the instructions.

Also, you can't single quote numerics like you can in MySQL.

As I said, I just got it working, and will update the document as I learn
more about the pecularities of the AS/400.

Oh, make sure to grab the replacement odbc_fetch_array code in the user
notes at http://www.php.net/manual/en/function.odbc-fetch-array.php

 -Original Message-
 From: Collins, Robert [mailto:[EMAIL PROTECTED]] 
 Sent: Tuesday, April 09, 2002 2:13 PM
 To: 'Rance Hall'; [EMAIL PROTECTED]
 Subject: RE: [PHP] AS/400 data access
 
 
 I am also trying to access data on an AS/400 have you gotten 
 it to work, if
 so can you send an example? Thanks in advance.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] AS/400 data access

2002-04-09 Thread Matt

Then, why not install the IBM odbc driver that comes with Client Access for
Windows and use it?

- Original Message -
From: Collins, Robert [EMAIL PROTECTED]
To: 'Matt Schroebel' [EMAIL PROTECTED]; Collins, Robert
[EMAIL PROTECTED]; 'Rance Hall' [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Tuesday, April 09, 2002 5:23 PM
Subject: RE: [PHP] AS/400 data access


 Thanks. Unfortunately this project is on a windows based platform, but
this
 may head me in the right direction.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php