|
I think that is based on an old example. The i5 functions no long exists
and were removed several version ago. You need to use the db2 functions(
http://php.net/manual/en/book.ibm-db2.php).
$conn = db2_connect("*LOCAL", "TESTPHP", "PASSPHP1") or
die(db2_conn_errormsg());
if (!$conn) die("<br>Connection using \"localhost\" with USERID and
PASSWORD failed. Error number =".db2_conn_error()." msg=".db2_conn_errormsg
())."<br>";
else echo "<br>Connection using \"localhost\" with USERID and PASSWORD
OK!<br>\n";
/* Close connection */
db2_close($conn);
Also, one other thing to note...
While you are free to create a user and use it, the following code may also
work:
db2_connect("*LOCAL", "", "");
If I am not mistaken, this will cause PHP to use QTMHHTTP user when
database calls are performed from HTTP jobs. Obviously, if you have very
strict access control in place for you your database, that may not work.
Still, it is worth mentioning as some would argue it is more secure.
One big plus is you don't have to remember to remove or change the username
and password whenever you post examples online.
On Mon, Apr 4, 2016 at 9:32 AM, PACHECO, Mauricio <
mauricio.pacheco@xxxxxxxxxxxxxx> wrote:
I just installed ZEND v8.0 over AS/400 V6R1. It looks like I am missing"*Fatal
something, which I don't know. Thanks in advanced!
I am trying to call a program thru PHP, but I am getting the error
error*: Call to undefined function i5_connect() inmsg=".i5_errormsg())."<br>";
*/usr/local/zendsvr6/var/apps/http/
192.168.0.36/10080/_docroot_/test/callpgm.php
<http://192.168.0.36/10080/_docroot_/test/callpgm.php>* on line *4*"
<HTML>
<?php
/* Connect to server */
$conn = i5_connect("localhost", "TESTPHP", "PASSPHP1") or
die(i5_errormsg());
if (!$conn) die("<br>Connection using \"localhost\" with USERID and
PASSWORD failed. Error number =".i5_errno()."
https://www.google.com/calendar/embed?src=mauricio.pacheco%40airliquide.com&ctz=America/Toronto&mode=week
else echo "<br>Connection using \"localhost\" with USERID and PASSWORD
OK!<br>\n";
/* Close connection */
i5_close($conn);
?>
</HTML>
Thanks,
*Mauricio Pacheco*
Systems Architect
*To see my calendar availability click here
<
https://www.google.com/calendar/embed?src=mauricio.pacheco%40airliquide.com&ctz=America/Toronto&mode=week| Cliquez ici
<
pour
voir mon agenda*
6990 Creditview Road,
Mississauga, ON L5N 8R9
Tel: (905) 855 0414 x 1102 - Mobile: (905) 601 4944
mauricio.pacheco@xxxxxxxxxxxxxx
www.vitalaire.com
[image: VitalAire Canada Inc.] <https://www.vitalaire.com>
--
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.
--
*Matt Lavinder Programmer AnalystData Management Inc.Phone: (336)
573-5045Fax: (336) 573-5001*
--
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 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.