2
Currently on my system, I am calling each column at once:
$sql2 = mysqli_query($db, "SELECT group_id FROM login WHERE userid = '$userid'");
$exibe2 = mysqli_fetch_assoc($sql2);
$_SESSION['group_id']=$exibe2['group_id'];
And in the file I’m calling so:
echo ' '.$_SESSION['group_id'].' ';
It works perfectly for only one table data, but in case I wanted to do something like:
$sql4 = mysqli_query($db, "SELECT account_id,userid,sex,email,group_id,last_ip,unban_time,diasvip,cash2 FROM login ORDER BY account_id WHERE userid = '$userid'");
$exibe4 = mysqli_fetch_assoc($sql4);
In case I want to fetch several columns that have several results each, as I do to call this result in PHP?
How hard it is to do the same thing?
– Maniero
In case I was calling so:
$_SESSION['group_id']=$exibe2['group_id'];now I would call it so?$_SESSION['verdados']=$exibe4;because it’s not just one more column I want to pick up, it’s several. And if I use it the way I posted it, it returns the following error:Notice: Array to string conversion in– GGirotto
But you’re wanting to do something different, if you want multiple columns, use multiple columns, just play what you did with one another. Not to invent a new way.
– Maniero