Re: session variable in select query showing picture from database

From: Date: Thu, 12 Feb 2009 18:17:14 +0000
Subject: Re: session variable in select query showing picture from database
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-45941@lists.php.net to get a copy of this message
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)?

« previous php.db (#45941) next »