Ver Mensaje Individual
  #2 (permalink)  
Antiguo 23/08/2012, 18:11
roodriv
 
Fecha de Ingreso: junio-2012
Mensajes: 46
Antigüedad: 11 años, 10 meses
Puntos: 1
Respuesta: Error en consulta MySQL

Es un error en la consulta, proba así.
Código PHP:
Ver original
  1. mysql_connect($host,$user,$pass) or die (header ("Location index.php?error=x001"));
  2. mysql_select_db($database) or die (header ("Location index.php?error=x002"));
  3. * * if ($v1 = "" || $v2 = ""){
  4. * * * * header ("Location index.php?error=x003");
  5. * * }else{
  6. * * * * $result = mysql_query('SELECT usuario, contraseña, id FROM usuarios WHERE usuario= '.$usuario.');
  7. * * * * *if($row = mysql_fetch_array($result)){
  8. * * * * * * if($row["contraseña"] == $password){
  9. * * * * * * * * $_SESSION["usuario"] = $row['usuario'];
  10. * * * * * * * * $_SESSION["activo"] = "si";
  11. * * * * * * * * $_SESSION["id"] = $row['id'];
  12. * * * * * * * * header ("Location home.php");
  13. * * * * }
  14. * * * * else
  15. * * * * {
  16. * * * * * * header ("Location index.php?error=x004");
  17. * * * * }
  18. * * * * * * }else{
  19. * * * * * * header ("Location index.php?error=x005");
  20. * * }
  21. * * * *
  22. * * }