Error when calling DB table

0

I'm a beginner in MySQL and PHP , and I want to basically list the information I have in db in>. I made the code and are returning these errors:

  

Warning: mysqli_select_db () expects parameter 1 to be mysqli, string   given in C: \ xampp \ htdocs \ testeman \ vendo.php on line 10

     

Notice: Undefined variable: with in C: \ xampp \ htdocs \ testeman \ vendo.php   online 13

     

Warning: mysqli_query () expects parameter 1 to be mysqli, string given   in C: \ xampp \ htdocs \ testeman \ vendo.php on line 13

     

Warning: mysqli_error () expects exactly 1 parameter, 0 given in   C: \ xampp \ htdocs \ testeman \ vendo.php on line 13

Github of the code: link

I'm new to the site and I'm confused about putting the code here.

    
asked by anonymous 11.12.2018 / 01:03

1 answer

0

Check if you are like this:

<? php

$servidor = "localhost";
$usuario = "root";
$senha = "";
$dbname = "teste123";

// coneão ao banco de dados
$conn = mysqli_connect ($servidor, $usuario, $senha, $dbname);

$query = "SELECT nome, email, assunto FROM suatabela";
$dados = mysqli_query ($conn,$query);
$linha = mysqli_fetch_assoc ($dados);

 ?>

The mysqli_query connection was reversed, I also noticed lots of incorrect variables.

    
11.12.2018 / 01:16