• 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

str_replace or preg_replace random number from string

MySQL/PHP - Web Based Game -User specific inventory table or 1 giant table? Another option?

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

How can I format this number correctly using PHP?

Laravel no logout option from menu after successfull login

PHP Slim Framework request using withAttribute error

How to fix 'Data has already been sent to output, unable to output PDF file' in MPDF

How to remove index.php and index from the URL using htaccess | PHP

PHP Sorting - getting 10, 11, 12 ... 1, 20, 2 rather than 1, 10, 11, 12 ... 2, 20

error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure

Laravel PHP: multiple project run at the same time [closed]

Autoloading classes in PHPUnit using Composer and autoload.php

Create a zip file and download it

MySQL default time format UTC or GMT?

(PHPUnit) PHP Fatal error: Uncaught Error: Call to undefined function each()

About Contact Privacy policy Terms and conditions