Last active
October 7, 2022 10:19
-
-
Save jonkerw85/4940b69e96c0a5935bbd5de991c40efd to your computer and use it in GitHub Desktop.
PHP PDO ODBC for IBMi AS/400 DB2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$UID = ''; | |
$PWD = ''; | |
$dsn = "odbc:Driver={IBM i Access ODBC Driver 64-bit};SYSTEM={IP_ADDRESS};PORT=50000;UID=$UID;PWD=$PWD;"; | |
$pdo = new \PDO($dsn); | |
$sql = 'SELECT * FROM XXXX LIMIT 10'; | |
foreach ($pdo->query($sql) as $row) { | |
print_r($row); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment