weird string literal related problem
| From: | Ratin | Date: | Mon, 01 Aug 2016 18:31:31 +0000 |
| Subject: | weird string literal related problem | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-49097@lists.php.net to get a copy of this message | ||
Hi I am new to this list, not sure how active this list is but i have a
question regarding php-sqlite integration. I am using a string variable
where I put the column name and trying to use that varible to get its
value, in a loop. So here is what I have (simplified version):
$strIndex='\'' . $columns[$i] . '\''; //strIndex has the value :
'decoderUserGUID' (including quotes)
$result = $db->query('select * from DecoderUser');
while ($entries = $result->fetchArray())
{
$value=$entries[$strIndex];
}
So if I print $value, I get nothing. But if i print
$entries['decoderUserGUID'] I get the correct value. If I print $strIndex,
I get 'decoderUserGUID' (including the quotes). How can I solve this
mistery.. whats hapenning here , Anybody have any idea?
Thanks
Ratin