Hi,
I am having a very awkward problem.
1st problem
This is my code:
if($count>0)
{
session_register("username");
session_register("nsecuserdid");
session_register("regno");
$_SESSION['username']=$_POST['username'];
$_SESSION['userid']=$login_row['userid'];
$_SESSION['regno']=$login_row['regno'];
header("location:newpage.php?=user=".$_SESSION['userdid']."");
}
Now the problem is that everything is working fine. Login is talking place. session is registered for username,regno but not for userid?
echo ("SESSION NAME ="." ".$SESSION['username']."<br>");
echo ("SESSION USERID ="." ".$SESSION['userid']."<br>");
echo ("SESSION REG NO ="." ".$_SESSION['regno']);
When am echoing i can see session name = value , session reg no = value but not id.
Why is this happening??
2nd Of all
if($SESSION['userdid'])
{
include_once("dbconfig.php");
$user_id=$SESSION['userdid'];
$username=$SESSION['username'];
$wbutrollno=$SESSION['regno'];
$tablename_details="userdetails";
$mysql_user="SELECT * FROM $tablename_details WHERE nsecsuserid='".$user_id."' AND username='".$username."' AND nsecwebregno='".$nsecwebregno."'";
$query_user=mysql_query($mysql_user);
$row_user=mysql_fetch_array($query_user);
$count_user=mysql_num_rows($query_user);
}
in this above code
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource
this error is created.
I think session id is not registered in the 1st problem that y the 2nd problem is created. Please help me out.
Thanks.