Blank page when executing sql command [closed]

0

When I run the index.php page, there is a form that goes to the login.php page

When the login page is executed it is completely blank, it does not execute anything.

The code is as follows:

<?php
include_once("../../conf.php");

$mysqli = mysqli_connect(HOST,user,PASS,DB) or die (mysqli_error());

$login = $_POST['login'];
$senha = $_POST['senha'];

if ($prep = $mysqli->prepare("SELECT * FROM Admin WHERE login=? AND password=?")) {
    $prep->bind_param('ss',$login,$senha);
    $prep->execute();

    if ($prep->error) {
        echo "erro";
    } else {
        echo "ok";
    }
} else {
    echo "erro 2";
}

The directory where conf.php is, there is a simple connection to the database using mysqli_connect.

What can happen? Not an error message or anything ..

    
asked by anonymous 12.05.2015 / 14:04

2 answers

1

Hello.

Try the following:

Where you have mysqli_connect simply put new mysqli .

    
12.05.2015 / 14:47
0

There's something missing like:

printf("%d Row inserted.\n", $stmt->affected_rows);

See the official documentation: Documentation

    
12.05.2015 / 14:06