ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> php-db
php-db
[PHP-DB] odbc
by Simpson, Doug other posts by this author
Sep 29 2003 4:37PM messages near this date
[PHP-DB] Supplied argument is not a valid File-Handle resource in | [PHP-DB] [fwd] Sybase (from: stephanb@whacky.net)
I am trying to connect to an AS/400 from a Linux box running RH9.
I have installed unixODBC and the iSeries drivers.
I can run "cwbping" that tell me that I am connecting to the AS400.
I have made a scipt the following script -
<HTML> 
<HEAD> <TITLE>ODBC Data Source</TITLE></HEAD>
<BODY> 
<?php
//odbc_query.php
        $odbc_dsn = "sysDSN";
        $odbc_userid = "RADCUR";
        $odbc_password = "sacsac";

        $query = "select * from radtcur.nfp";

        if(!($odbc_db = odbc_connect($odbc_dsn, $odbc_userid, $odbc_password)))
                die("Could not connect to ODBC data source $odbc_dsn");

        if(!($odbc_rs = odbc_exec($odbc_db, $query)))
                die("Error executing query $query");

        odbc_result_all($odbc_rs);

?> 
</TABLE> 
</BODY> 
</HTML> 

When I run this script from a web browser I get the following error in my http error logs

[client 172.16.32.241] PHP Warning:  odbc_exec(): SQL error: [unixODBC][IBM][iSeries
Access ODBC Driver][DB2 UDB], SQL state S1000 in SQLExecDirect in
/var/www/htdocs/odbcquery.php on line 15

Does anyone know why I am getting this?
Thank you for your time<
Doug

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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved