Hi, I'm trying to use a posted column name to output it's contents. It's hard for me to explain, so maybe the code below will speak better.
throws the error:PHP Code:
$field = $_POST['id']; // this is the column name posted from another page
$commanda = "SELECT * FROM users WHERE userid = '$_SESSION[user_id]'";
$resulta = mysqli_query($mysqli, $commanda) or die('error');
echo $resulta[$field]; // the line in question
Fatal error: Cannot use object of type mysqli_result as array