Session array in mysql query

hey there,

i have a variable in php called $_SESSION[‘memberinfo’]. it is an array.

anyone know the syntax so i don’t have to store an array value into a temporary variable? for example instead of:

$username = $_SESSION[‘memberinfo’][4];
$query =
“SELECT * FROM members where username=’$username’”;

use this instead:
$query =
“SELECT * FROM members where username=’$_SESSION[memberinfo][4]’”;


$query = “SELECT * FROM members where username=’” . $_SESSION[memberinfo][4] . “’”;

Don’t use backticks - that’d be equivalent to this:


which I assume you don’t want to do :wink:

thanks it works, i gotta use . notation for all queries now