Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /Applications/XAMPP/xamppfiles/htdocs/login.php on line 13
Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in /Applications/XAMPP/xamppfiles/htdocs/login.php on line 14
Warning: Cannot modify header information - headers already sent by (output started at /Applications/XAMPP/xamppfiles/htdocs/login.php:13) in /Applications/XAMPP/xamppfiles/htdocs/login.php on line 17
Dejo el codigo:
Código PHP:
<?php
session_start();
$usuario="root";
$password="";
$bd="admin";
mysql_connect('localhost',$usuario,$password);
mysql_select_db($bd) or die ("No podemos conectar con la Base de datos" );
if(isset($_POST['aceptar'])){
$emaile=$_POST['email'];
$pass=$_POST['password'];
$sql = mysql_query("SELECT email FROM administradores where ('$_POST[email]') and pass=('$_POST[password]')");
$num_filas= mysql_num_rows($sql);
$fila=mysql_fetch_assoc($sql);
if ($num_filas!=1){
$_SESSION['login'] = "ok";
header ("Location: administrar.php");
}
else{
$error= "ERROR";
header ("Location: administrar.php");
}
}
?>