로그인 할 때 사용할 로그인 폼을 만들었지 만 로그인을 시도 할 때 통과하지 못합니다. 아래는 내가 사용한 코드의 일부입니다. $num = mysql_num_rows()
이있는 부분은 $num
을 반향 할 때 0을 반환합니다. 왜 그렇게되는거야? 내 INSERT
쿼리가 결과를 반환하지 않는 것으로 보입니다. 도와주세요.로그인을위한 MySql 쿼리가 작동하지 않습니다.
if ($warning==''){
$query="SELECT first_name FROM tblusers WHERE (email='$username') AND (password='".md5($_POST['password'])."')";
[email protected]_query($query);
$num = mysql_num_rows($result);
@mysql_close();
echo $num."perfecto".$result;
if($num==1)
{
$u=new User($username);
include ('includes/highlight.inc.php');
//insert user into session
if ($username=='admin'){
$_SESSION['user']=$username;
$p=new Page('Log In'.$username);
$p->setHeading('Welcome '.$u->getFirstName());
$p->setContent($cont."<br/><br/><br/> Use the administrator's panel on the right to do the administration work of the
website. To block and unblock users you use the <font color=red><b>View Auctions</b></font> link, and
that is when you can block the user after assessing their record.");
$p->printIt();
} else {
$_SESSION['user']=$username;
$p=new Page('Log In'.$username);
$p->setHeading('Welcome '.$u->getFirstName());
$p->setContent($cont."<br/><br/><br/>".$text);
$p->printIt(); }
}
쿼리를 수동으로 확인하십시오 –
다음을 시도해보십시오. 검색어로 'email'= '$ username'및 password = 'md5 ($ _ POST ['password '])'를 선택하십시오. – Satya
'var_dump ($ query);'를 사용하여 포함 된 변수를 데이터베이스의 값과 비교하십시오. 그 이외의 질문 (mysql 확장은 PHP 5.5.0에서 더 이상 사용되지 않으며 이후에 제거 될 것입니다.) 대신 MySQLi 또는 PDO_MySQL 확장을 사용해야합니다 .. – Bjoern