• 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

Unable to guess the mime type as no guessers are available Laravel 5.2

Transform array, set each array element with parent key php

Unable to create lockable file - Laravel 8 & PHP 8

How to install php yaml on CentOs?

Explode not working properly with dash

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

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

Reload parent page after submit in iframe

500 Internal Server Error on Ajax request. Not sure the origin of the problem

Symfony 4: how to allow dynamic values for array nodes in bundle configuration?

Laravel Delete and Update

How to install ZeroMQ for PHP on an Alpine Linux container?

Why rand() every time I refresh the page?

Undefined variable in Laravel 8 project (php 7.4)

Error when uploading certain .png files "Interlace handling should be turned on when using png_read_image"

About Contact Privacy policy Terms and conditions