|
|
|
ใครพอรู้เรื่อง PHP Toolkit Functions หรือการเชื่อมต่อ i5 connect PHP to an AS/400 บ้างครับ |
|
|
|
|
|
|
|
มันก็มีคู่มือ/เอกสารให้อยู่แล้วน่ะครับ
Code (PHP)
$conn = i5_connect("1.2.3.4", "MYUSER", "MYPWD");
if (!$conn) {
die(i5_errormsg());
}
|
|
|
|
|
Date :
2013-03-12 12:16:12 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
โฮตัวอย่างเพี๊ยบเลย
Code (PHP)
/* Basic connection to i5/OS */
$conn = i5_pconnect("i.2.3.4","USER","PWD", array(i5_OPTIONS_IDLE_TIMEOUT=>120))
or die(i5_errormsg());
echo " Connection OK <BR>";
/* Connection error detail in case of failure */
$conn = i5_pconnect("i.2.3.4","MYUSER","MYPWD");
if (!$conn) {
$error = i5_error();
echo " Error during connection\n";
echo "<BR> Error number: ".$error["num"];
echo "<BR> Error category: ".$error["cat"];
echo "<BR> Error message: ".$ error ["msg"];
echo "<BR> Error description: ".$ error ["desc"];
trigger_error("I5 persistent connection fails", E_USER_ERROR);
}
else {
echo " Connection OK ";
$isnew = i5_get_property(I5_NEW_CONNECTION);
if ($isnew) ) {
echo " New connection. Do some job initialization \n";
}
}
/* leaves connection without closing it. */
/* Make it available for another script. */
$ret = i5_close($conn);
if($ret){
echo " I5 disconnected";
}
else
{
$ret = i5_errormsg($conn);
}
|
|
|
|
|
Date :
2013-03-12 12:16:50 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 05
|