Re: session variable in select query showing picture from database

[email protected] (Mika Jaaksi)
Newsgroups php.db
Message-ID <[email protected]>
I tried
$query = "SELECT * FROM pic_upload WHERE band_id =
'".$_SESSION['session_var']."' ";
didn't work.

And I've tried to echo session variable and it has right data in it.

I've also tried

band_id=$band_id
band_id='$band_id'
band_id="$band_id"
band_id='{$band_id}'
band_id="{$band_id}"

Session variable is 11 in this case and the picture is shown when I use
...WHERE band_id=11... but not when I use variable.
What could be the difference between plain number (11) and variable (I've
echoed it so I know it's 11 too)?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.