You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have Laravel 8 project with (PHP version 7.4). I have also setup database credentials in database.php file. When i tried to fetch record from database in controller, then this error came.
$products = LeiobjProduktP::limit(1)->get(); return response()->json(['products' => $products]);
On hosting server, Db2 can not access using odbc driver.
I have done simple PHP script to make connection with db. it worked successfully. Here is script
$host = 'dummy'; // The IP address or hostname of your IBM i server
$database = 'dummy'; // The name of your database on the IBM i system
$username = 'test'; // Your database username
$password = 'test'; // Your database password // Construct the ODBC connection string
$port = 80000;
$dsn = "DRIVER={IBM i Access ODBC Driver};DATABASE=$database;SYSTEM=$host;Port=$port;PROTOCOL=TCPIP";
$connection = db2_connect($dsn, $username, $password); // Check if the connection was successful
if ($connection) {
echo "Connected to the IBM i database."; // Perform database operations here
db2_close($connection); // Close the database connection when done
} else {
echo "Failed to connect to the IBM i database.";
}

Please guide regarding this.
The text was updated successfully, but these errors were encountered:
I have Laravel 8 project with (PHP version 7.4). I have also setup database credentials in database.php file. When i tried to fetch record from database in controller, then this error came.
extension installed on server
Here is db credentials are like this
In controller, I have done like this
$products = LeiobjProduktP::limit(1)->get(); return response()->json(['products' => $products]);
On hosting server, Db2 can not access using odbc driver.
I have done simple PHP script to make connection with db. it worked successfully. Here is script
Please guide regarding this.
The text was updated successfully, but these errors were encountered: