<?php
session_start();
$ojbConnect=oci_connect("ccare_rpt","ccare_rpt","10.10.18.226/ICDRP");
$username = $_POST['username'];
$password =$_POST['password'];
if($username == ''){
echo "Enter Username";
} elseif($password == ''){
echo "Enter Password";
}
else {
$strSQL = "select * from tb_user_rpt t where t.username = '$username' and t.passwd = '$password'";
$objParse = oci_parse($ojbConnect,$strSQL);
oci_execute ($objParse,OCI_DEFAULT);
$num = oci_num_rows($objParse,OCI_DEFAULT);
if ($num <= o) {
echo "<meta http-equiv='refresh' content='1;URL=index.php'>";
} else {
while ($user = oci_fetch_array($objParse)){
// Admin
if ($user['POSITION'] == 1){
$_SESION['USID'] = session_id();
$_SESION['USERNAME'] = $user['USERNAME'];
$_SESION['POSITION'] = "Admin";
// send to adin page
echo "<meta http-equiv='refresh' content='1;URL=user.php'>";
// user
} else {
$_SESION['USID'] = session_id();
$_SESION['USERNAME'] = $user['USERNAME'];
$_SESION['POSITION'] = "user";
// send to user page
echo "<meta http-equiv='refresh' content='1;URL=user.php'>";
}
}//end while
}// end else
}
?>
เมื่อกด Login มันเกีด Error ขื้นมา
Warning: oci_num_rows() expects exactly 1 parameter, 2 given in C:\AppServ\www\reportcall\RPT_CRM\check_login.php on line 23