• 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 programmatically find public properties of a class from inside one of it's methods

PHP Startup Unable to load dynamic library /usr/lib/php/20151012/php_mysqli.dll

Display a product custom field only in WooCommerce Admin single orders

Laravel Route issues with Route order in web.php

Laravel 5.1 Unknown database type enum requested

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource [duplicate]

Having trouble with PDO queries (Notice: Undefined index)

PHPExcel export HTML table to xlsx

Show rotation of tweets using current day of month

Cut an arabic string

How do I refresh a DIV content?

Undefined Array Key error when uploading image on php

carbon generated datetime not stored correctly into the database

Split a string array into pieces

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

About Contact Privacy policy Terms and conditions