Query with variable from a page
-
Hi Eli
I have a page where the id of the user is passed via the URL …page/?uid=6
From the URL I am able to extract the id into a variable $userid. I do this on the page itself using a plugin that enables thisMy query has a where clause ‘WHERE (post_author =6 )’ which worked with the hard coded ID as above
I am adding a shortcode of the query to the page which looks good when hard coded id
I have tried using ‘WHERE (post_author ='<? php $userid ?>’ )’ and a couple of variants with no luck
How can I use the $userid variable in the query
Thanks
Michael
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Query with variable from a page’ is closed to new replies.