Connect to SQL in a php PDO and print the data in it
<?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:
- check null in_array php
- check array in array key
- Dynamic title on every page laravel blade
- convert string to date php
- Cache::forget laravel command
- $get url php
- Format Month as a number php
- Route [login] not defined.Route [login] not defined.
- eloquent all only one culomn
- contains function in php
- clear cache in laravel in windows cmd
- create child theme in wordpress
- check_string_lenght in php
- create laravel 5.8 project using composer
- adeleye ayodeji
- control string length php
- encryption key has not encrypted laravel
- Your Composer dependencies require the following PHP extensions to be installed: dom, mbstring, xml, xmlwriter
- cache out en laravel
- Str::random
- artisan clear cache command
- console log with php on form sent
- eloquent run seeder
- cacert file_get_contents openssl