• 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

How to downgrade or install a specific version of Composer?

PHP echo values of all sub keys [duplicate]

Fatal error: Uncaught Error: Call to undefined method mysqli_stmt::fetch_assoc() [duplicate]

Laravel display validation error

Nginx disallowing execution of PHP in uploads directory with Magento

WordPress + Nginx on non-standard port behind AWS ELB results in broken links

Having issue with matching rows in the database using PDO

Laravel Displaying image from database

The sum of the user's points

Check for PDO Results, If None Display Message, If Yes then Loop Through

how to prevent float variables displaying as scientific notation when printing [duplicate]

Issue saving card for customer

How to generate QR CODE for dynamic generating link and logo using Simple QrCode in laravel?

Phpunit partial mock + proxy Entity

PHP7 CLI attempts to load xdebug twice - "Cannot load Xdebug - it was already loaded"

About Contact Privacy policy Terms and conditions