validate entries to a database from different devices through a web application in xampp

0

I have problems validating entries to a database through a web application, I'm trying to do with a xampp server, and a web application in html, I can see the database from my Android device, and the web application, but when I want to insert data, I find connection error someone who can help me.

<?php abstract class DBAbstractModel { 

    private $db_host = "localhost"; 
    private $db_user = "root"; 
    private $db_pass = "my password"; 
    private $db_name = "base de datos"; 
    protected $query; 
    protected $rows;// = array(); 
    private $conn; 
    private function open_connection() { 

        $this->conn = new mysqli($this->db_host, $this->db_user, $this->db_pass, $this->db_name); 
        $this->rows=null; 
        $this->rows=array();

}

I only see the connection error message with the ip of the computer where the xampp server is.

    
asked by mezu 28.06.2018 в 04:15
source

1 answer

0

Here is an example of my connection:

<?php

$dbHost = 'localhost';
$dbUsername = 'root';
$dbPassword = 'nacho';
$dbName = 'Test';

//Crea la conexion y elige la base de datos a usarse
$link = new mysqli($dbHost, $dbUsername, $dbPassword, $dbName);

if ($link->connect_error) {
die("Falló la conexion con la base de datos: " . $link->connect_error);
}
    
answered by 28.06.2018 / 16:09
source