[Resolvido] Erro de mysql_fetch_array()
Poxa meu script tava funfando normal atualizei o php e apareceu isso ;/
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/xxxxx/public_html/admin/password.php on line 8
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/xxxxx/public_html/admin/password.php on line 9
Warning: Cannot modify header information - headers already sent by (output started at /home/xxxxx/public_html/admin/password.php:8) in /home/xxxxx/public_html/admin/password.php on line 35
a pagina password.php
<?
session_start();
include("admin.config.inc.php");
include("connect.php");
$query="select * from admin where username='".$_POST["name"]."' and pass='".$_POST["pass"]."'";
$result=mysql_query($query,$db);
$row=mysql_fetch_array($result);
$total = mysql_num_rows($result);
$name=$_POST['name'];
$pass=$_POST['pass'];
$ADMIN_USERNAME=$row["username"];
$ADMIN_PASSWORD=$row["pass"];
if($total>0)
{
if($name==$ADMIN_USERNAME && $pass==$ADMIN_PASSWORD)
{
if(isset($UsErOfAdMiN))
{
setcookie("UsErOfAdMiN","");
$UsErOfAdMiN="";
}
$_SESSION["UsErOfAdMiN"] = $name;
$_SESSION['logedin'] = true;
$_SESSION["type"] = $row["type"];
$_SESSION["usrname"] = $name;
$_SESSION["logid"] = $row["id"];
header("Location:innerhome.php");
}
}
else
{
header("Location:index.php?id=1");
}
?>Discussão (2)
Carregando comentários...