• 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

Laravel 8 factory state afterCreating

How to show a popup modal in codeIgniter?

WAMP/Wordpress - cURL error 28: Operation timed out after 10001 milliseconds with 0 bytes received

storagelogs/laravel.log" could not be opened in append mode: failed to open stream: Permission denied

Wordpress add responsive srcset header image to theme

echo language construct is discouraged. (PHP)

PHP Fatal error: Class not found - PHPUnit

How can I format this number correctly using PHP?

Laravel Gates using model and returns "Using $this when not in object context" Line 28 of AzureUser model

How to get the total hour from starting time to end time in php

Doctrine ORM: Excluding Records Based on Values of Nested Relationships

How to validate Envato Purchase Code in PHP

How to create a scheduler application in php

SQL to convert multiple rows into a single row of variable length

PHPExcel How to set conditional formatting to change cell background color based on cells values

About Contact Privacy policy Terms and conditions