• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

Fatal error: Uncaught mysqli_sql_exception: Unknown database 'test' in ... (How do I fix that? Using PHP)

phpmysqlmysqli


PHP Snippet 1:

<?php
$mysqli = new mysqli("localhost","my_user","my_password","my_db");

// Check connection
if ($mysqli -> connect_errno) {
  echo "Failed to connect to MySQL: " . $mysqli -> connect_error;
  exit();
}
?>

Related Snippets

I need to link Google Sheet with my Laravel

Cannot pass null argument when using type hinting

PHP rotate matrix counter-clockwise

I cannot create a auto generated date time in mysql workbench

How to delete old images from public folder on update using Laravel

MySQL - Connection failed: No route to host

Split array into 4-element chunks then implode into strings

Using if(isset($_POST['submit'])) to not display echo when script is open is not working

How to get Laravel's CSRF Token from Another Website?

PHP how to detect if running on arm64 cpu?

Connecting an HTML webpage to a SQL Server

PHP: PDO + CSV export not downloading (headers issue?)

Woocommerce Checkout - Add conditional field required if one field is filled

"Notice: Undefined variable", "Notice: Undefined index", "Warning: Undefined array key", and "Notice: Undefined offset" using PHP

How can i hide dt if dd got empty value

About Contact Privacy policy Terms and conditions