DB::connection() for php
<?php
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "myDB";
// Create connection
$conn= mysqli_connect($servername,$username,$password,$dbname);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
echo "Connected Successfully.";
?>$servername = "localhost";
$username = "username";
$password = "password";
// Create connection
$conn = new mysqli($servername, $username, $password);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";
Simplified
$conn = mysqli_connect('localhost', 'username', 'password');
$database = mysqli_select_db($conn, 'database');
Also in PHP:
- base64 to string pp
- check string php
- create well formated json php
- CODEIGNITER codeigniter 4 auth
- Allowed memory size of 536870912 bytes exhausted (tried to allocate 264245248 bytes) http://localhost:8000/createProduct
- error correction in qr code php
- base64 image php
- count duplicate strings array php
- create migration table in php
- artisan make seeder
- DATE_FORMAT(STR_TO_DATE
- 150 charachter display only php
- clear cach laravel
- detect find char in string php position
- artisan run seeder
- 12 digit alphanumeric random number generator php
- Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar://C:
- check if a word in string php
- errpr reporting in php
- composer require php '^5.4'
- check if there is string in string php
- None of the supported PHP extensions (PgSQL, PDO_PgSQL) are available.
- display file error php
- create folder by php