× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



You need to use a dot (lib.file) between the library and file:

$result = db2_exec($conn,"Select * from TWFT*.*TWF10");


On Tue, Mar 31, 2015 at 4:42 PM, Larry Kleinman <larry@xxxxxxxxxxxxxxxxx>
wrote:

So here is my code now

$db = 'IASP1';
$user = 'xxxx';
$pass = 'xxxxxx';
$conn = db2_connect($db, $user, $pass);
$result = db2_exec($conn,"Select * from TWFT/TWF10");
if ($result) {echo 'this is good';} else echo 'this is bad';

and I see "this is bad" in the browser and get the folling in the php.log
file

PHP Warning: db2_exec(): Statement Execute Failed

Larry Kleinman
Kleinman Associates, Inc.
212-949-6469




From: Alan Seiden <alan@xxxxxxxxxxxxxx>
To: "Web Enabling the IBM i (AS/400 and iSeries)"
<web400@xxxxxxxxxxxx>,
Date: 03/31/2015 08:40 AM
Subject: Re: [WEB400] using SQL and Zendserver
Sent by: "WEB400" <web400-bounces@xxxxxxxxxxxx>



Generally yes, but here's a tip on how to share the db2 connection:
http://forums.zend.com/viewtopic.php?f=113&t=46688&hilit=share

By the way, after you call getInstance(), remember to add this line:
$conn->setOptions(array('stateless'=>true));
so that the toolkit won't have to spawn additional jobs. 'stateless'
mode works best for most people.

Alan

Larry Kleinman wrote:
Thanks Alan. Does that mean that if I call an RPG program from the
same
script at I use SQL, that I need to do a db2_connect as well as a
ToolkitService:getInstance

Larry Kleinman
Kleinman Associates, Inc.
212-949-6469




From: Alan Seiden<alan@xxxxxxxxxxxxxx>
To: "Web Enabling the IBM i (AS/400 and iSeries)"
<web400@xxxxxxxxxxxx>,
Date: 03/31/2015 08:29 AM
Subject: Re: [WEB400] using SQL and Zendserver
Sent by: "WEB400"<web400-bounces@xxxxxxxxxxxx>



Hi, Larry,

For SQL, use the db2_* functions (db2_connect, db2_prepare, db2_execute,
etc.). New toolkit didn't re-implement these since they were provided in
the ibm_db2 extension.

Alan
--
*Alan Seiden Consulting LLC*

Project leader, Zend PHP Toolkit for IBM i
Zend Framework certified contributor

Office: 201-447-2437 Cell: 201-248-4704
http://www.alanseiden.com | alan@xxxxxxxxxxxxxx
http://twitter.com/alanseiden


Larry Kleinman wrote:
I have used i5_query and -5_program_call for years to do an SSL and RPG
calls from ZendServer for IBM i, but am now using the newer Toolkit. I
have RPG calls working, but can't find documentation for SQL. Here's
how
I do the RPG stuff

require_once('ToolkitService.php');
$conn = ToolkitService::getInstance($db, $user, $pass);
$params[] = $conn->AddParameterPackDec('both', 9, 2, '', '', $OHSHDS);
$result = $conn->PgmCall('TWR001', '', $params, null, null);

I have been searching the Zend site for the last two hours and cant'
find
anything

Help

Larry Kleinman
Kleinman Associates, Inc.
212-949-6469
--
This is the Web Enabling the IBM i (AS/400 and 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.


--
This is the Web Enabling the IBM i (AS/400 and 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 thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.