• 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

How to install PHP composer inside a docker container

jQuery Ajax Post with data

add_action() function in wordpress not working [duplicate]

Sync Records With Default Values in Pivot Tables, Call to undefined method syncWithPivotDefaults()

Unsure why I am getting: Number of variables doesn't match number of parameters in prepared statement

The difference when using if statement true === something() vs something() === true [duplicate]

Laravel Command Schedule Not Working Properly

PHP-Sort array based on another array?

Laravel 5.5 change unauthenticated login redirect url

generating a random code in php?

Laravel/ PHP: Order By Alphabetical with numbers in order [duplicate]

Convert PHP array into HTML tag attributes separated by spaces

Loading data from MySQL and populating dropdown select with jQuery Mobile, PHP

Laravel phpunit test failing authorization

how to get value from array in laravel

About Contact Privacy policy Terms and conditions