|
Kelly, > $odbc = > odbc_connect("mysystem","myusername","mypassword") or > die("Couldn't define connection"); maybe change $odbc above to match $conn_ODBC below i.e. $conn_ODBC = odbc_connect("mysystem","myusername","mypassword") or die("Couldn't define connection"); $res400 = odbc_columns($conn_ODBC, "mysystem", $libname, $filename, "%") or die(odbc_errormsg()); joeM ----- Original Message ----- From: "Kelly Cookson" <kc62301@xxxxxxxxx> To: <WEB400@xxxxxxxxxxxx> Sent: Monday, August 23, 2004 11:37 AM Subject: [WEB400] Still trying to access iSeries database with PHP > I'm trying to connect to iSeries database files using > PHP and the iSeries Access ODBC driver. I have PHP > running on Apache on a W2K machine with a network > connection to an iSeries. > > I have a System DSN defined using the iSeries Access > ODBC Driver 9.00.06.00 where the data source name is > "mysystem". > > Here's the php script I created based on the example > from the online PHP manual (where "myusername" is my > iSeries user name, "mypassword" is my iSeries > password, MYLIB is a library name, and MYFILE is a > physical file): > > <?php > file://Define the connection to the database. > $odbc = > odbc_connect("mysystem","myusername","mypassword") or > die("Couldn't define connection"); > file://Define the library and file name. > $libname = "MYLIB"; > $filename = "MYFILE"; > file://Get the info. > $res400 = odbc_columns($conn_ODBC, "mysystem", > $libname, $filename, "%") or die(odbc_errormsg()); > file://Display results. > echo odbc_result_all($res400); > ?> > > The script fails on the attempt to assign $res400. > The message from odbc_errormsg() reads as follows: > > Warning: odbc_columns(): supplied argument is not a > valid ODBC-Link resource in > c:\apacheserver\Apache\htdocs\php\iseries1.php on line > 14 > > Is there anything special I need to do when defining > the DSN? Would anyone be willing to share a code > example of how to connect to and query an iSeries > database file using PHP running on Apache on a W2K > machine? > > Thanks in advance for any help! > Kelly > > > > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 50x more storage than other providers! > http://promotions.yahoo.com/new_mail > _______________________________________________ > This is the Web Enabling the AS400 / iSeries (WEB400) mailing list > To post a message email: WEB400@xxxxxxxxxxxx > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/mailman/listinfo/web400 > or email: WEB400-request@xxxxxxxxxxxx > Before posting, please take a moment to review the archives > at http://archive.midrange.com/web400. >
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.