query_posts passing a variable
-
Hello,
I have somewhat strange problem.
Within the code, I am trying to send variables to the query_posts and it shows the posts according to user’s input.
Now, to the problem.
I am passing a variable which is serialized and stored as “meta_value”; Now, I want to show posts according to that.
$thisserial = 'a:3:{i:0;s:14:"American Samoa";i:1;s:7:"Andorra";i:2;s:6:"Angola";}'; $querystring = "&meta_value="."$thisserial" ; query_posts('category_name=some_category'.$querystring);
Now, wordpress should search the meta_value as same as $thisserial and give me all the posts, but it’s not. There is some problem with the format of the string, some apostrophes, colons or something that it hampering wordpress to show me posts matching this criteria.
Whenever the variable $thisserial is normal as something like “This Value”, it shows everything normally.
Can I have any assistance?
How can I pass this variable ?
Many Many Thanks
- The topic ‘query_posts passing a variable’ is closed to new replies.