Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\Ayyam v3\gate.php on line 16
Warning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\Ayyam v3\gate.php:16) in C:\AppServ\www\Ayyam v3\gate.php on line 36
am new with php please help me
<?php
session_start();
require_once('Connections/connector.php');
$uid= $_POST['uid'];
$upw = md5($_POST['uPw']);
//manual sql search...
$userRec = mysql_query("select * from `user` where
`user`.`uid`='$uid'
AND
`user`.`uPw`='$upw';
");
//check number of user records found... only 1
$userRecFound = mysql_num_rows($userRec);
//check if above sql finds a record...
if($userRecFound==1){
//store user id in a session variable for later security...
$_SESSION['uid'] = $uid;
while($userRecFetcher=mysql_fetch_array($userRec)){
//if user type = admin
if($userRecFetcher['uType']=='admin'){
header("location: controlPanel.php");
}
//if user type = reg
elseif($userRecFetcher['uType']=='reg'){
header("location: controlPanelReg.php");
}
}
}
//if not in database...
else{
header("location: deny.php");
}
?>