$pdo= new PDO(
<?php
$servername = "localhost";
$username = "username";
$password = "password";
try {
$conn = new PDO("mysql:host=$servername;dbname=myDB", $username, $password);
// set the PDO error mode to exception
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
echo "Connected successfully";
}
catch(PDOException $e)
{
echo "Connection failed: " . $e->getMessage();
}
?>
Also in PHP:
- acf post object
- datetime format php datetime
- check type of variable in php
- debuggin native php
- exceptional handling in php
- errors register
- enable php error output
- create new laravel project with specific version
- download php artisan
- array kley exists php
- Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.3.0".
- check if substring is present php
- array_column in php
- current date in codeigniter
- Dijkstra’s algorithm php
- Adding string with number in php
- F d php
- Allowed memory size of 1610612736 bytes exhausted larave lvalet composer
- Generate Laravel Migrations from an existing database
- current domain in php
- count the length of a string php
- Laravel 7 do not see my new added seeder
- catch error php
- date time long format php