Jump to content
Fórum Script Brasil
  • 0

Ajuda com mysqli_fetch_array em php



Abaixo segue o meu código em php e a imagem com o erro em anexo. 
Por favor, me ajudem.



class conexion{

    private $conexion; 
    private $server = "localhost"; 
    private $usuario = "root"; 
    private $pass = "";
    private $db = "juventude"; 
    private $user ; 
    private $password;

    public function __construct(){

        $this->conexion = new mysqli($this->server, $this->usuario, $this->pass, $this->db);


            die("Falha a conectar ao Banco de Dados MYsql: (". $this->conexion->connect_errno.")");


    public function cerrar(){



    public function login($usuario, $pass){

        $this->user = $usuario;
        $this->password = $pass;

        $query = "select nome, login, senha from cadastro where usuario = '".$this->user."' and password = '".$this->password."'";

        $consulta = $this->conexion->query($query);

        if($row = mysqli_fetch_array($consulta)){


            $_session['nom'] = $row['nome'];
            $_session['ape'] = $row['apellido'];

            echo "Logou"; 

        }else {

            echo "login ou senha errados"; 







Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Forum Statistics

    • Total Topics
    • Total Posts
  • Create New...