• 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

How to test a php login connected to a mysql db through xampp?

phpmysqllogindirectoryxampp


PHP Snippet 1:

include "../storescripts/connect_to_mysql.php";

PHP Snippet 2:

include "C:\xampp\htdocs\myonlinestore\storescripts\connect_to_mysql.php";

PHP Snippet 3:

<?php
   $server = "localhost";
   $connection = mysqli_connect ($server,"root","","your_database_name");
   if(!$connection){
    // if not connected it will gives the error here
    echo "server not found".mysql_error();
}   
else{
    echo "Connected";
}
?>

Related Snippets

Boolean assignment operators in PHP

PHP file_get_contents function

How can I stop a symfony process which is listening on http://127.0.0.1:8000

How to use PHPCBF to fix one issue at a time?

Split a string array into pieces

Composer fails with kylekatarnls/update-helper on new homestead

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given [duplicate]

How to execute sql code based on fetch array

PHP Startup: Unable to load dynamic library 'openssl' in Ubuntu

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

SQL AVG() to 2 decimals

Docker image build with PHP zip extension shows "bundled libzip is deprecated" warning

Any AWS EB Laravel route getting 404 Not Found nginx/1.16.1

echo language construct is discouraged. (PHP)

How to assert parameter attribute sub-structures in PHPUnit mock call expectations

About Contact Privacy policy Terms and conditions