Click here to Skip to main content
15,881,709 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Friends.
I am doing my academic project.
I want to fetch table values in a session variable on page1.php and pass it to page2.php. but i got a warning :


"Warning: main(): Couldn't fetch mysqli_result in C:\xampp\htdocs\AirTicket\booking.php on line 17
";

my page1.php code:

session_start();
$_SESSION['res'];
?>
<html>
<body>

$con = mysqli_connect("localhost", "user", "****", "****");
$query = "select * from ****";
$_SESSION['res'] = mysqli_query($con, $query);
?>

Page2.php
</body>
</html>




page2.php Code:

<html>
<head>
</head>
<body>
session_start();
echo $_SESSION['res'];

foreach ($_SESSION['res'] as $row)
{
echo "EmpId: ";
echo $row["EmpId"];

echo "Salary";
echo $row["Salary"];
print("
");
}

?>
</body>
</html>


After execute it on page2.php it shows:
"Warning: main(): Couldn't fetch mysqli_result in C:\xampp\htdocs\AirTicket\booking.php on line 17
";
Posted
Comments
garav kumar mishra 18-Dec-13 13:09pm    
wrong question mission most of things
Killzone DeathMan 2-Jan-14 6:28am    
mysqli_connect("localhost", "user", "****");

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900