• 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

PHP: Calling MySQL Stored Procedure with Both INPUT AND OUTPUT Parameters (NOT "INOUT")

How to connect to MSSQL Server with PHP from Ubuntu 18.04?

PHP Array split string and Integers

Cannot pass null argument when using type hinting

How to upload mpdf file after generating to s3 bucket in php

RuntimeException: Unable to create the cache directory (/var/www/sonata/app/cache/dev)

PHP Imap , php 7.4.3 on mac osx catalina

Generate random username based on full name php

getting error while enter Command => php artisan route:list

Check If array is null or not in php

Sentry + Laravel: how to log an already catched Exception?

How to convert a carbon into string, to take the date only?

How to separate letters and digits from a string in php

Populate Dynamic Dropdowns List in Codeigniter

Get WooCommerce products from specific category

About Contact Privacy policy Terms and conditions