我试图创建一个登录页面,但是每次我得到结果时,都是因为用户不在数据库中。我试图为mysql_num_rows设置不同的值:我用== 0; === 0; > 0并且!= 0。我不知道问题出在哪里
b<?php
require_once('config.php');
if( isset($_GET['actiune']) && $_GET['actiune']=="conectare")
{
$email=isset($_POST['user'])?$_POST['user']:'';
$parola=isset($_POST['psw'])?$_POST['psw']:'';
$sql="SELECT *
FROM utilizatori
WHERE email='$email'
AND parola='$parola'";
$rez=mysql_query($sql);
if(mysql_num_rows($rez)==0)
echo 'Ati gresit parola sau nu sunteti inregistrat';
else {
$_SESION['online']='da';
$_SESION['user']=$_POST['user'];
if($_SESION['user']=="qwer")
echo '<meta http-equiv=refresh content="0"; url=admin.php">';
else
echo '<meta http-equiv=refresh content="0"; url=user.php">';
}
}
?>