Retrieve all values from an SQL table and add to a session

Asked

Viewed 55 times

1

I am using the following code to get all data from my table:

$sql4 = mysqli_query($db, "SELECT * FROM login");
$exibe4 = mysqli_fetch_assoc($sql4);

It’s working perfectly and it’s picking up all the normal data.

However, before when it was a specific data I would add to session thus:

$_SESSION['diasvip']=$exibe['diasvip'];

However, now as I want ALL data do not know how to do!

$_SESSION['dados']=$exibe4['*'];

Obviously with this asterisk would not work, but only to illustrate my goal.

  • 1

    If dados is an array, just do $_SESSION['dados']= $exibe4 I think it should work.

  • Sorry for the delay! Here is part of the code: http://pastebin.com/razYfk8Y

  • William, this code is irrelevant to the issue, already managed to resolve?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.