Variable in URL not working to display data correctly on a page
-
I have this query in the plugin admin page, but when I put the short code on my page, it only shows One Row of the entries, when there should be more. If I HARD CODE an ID in this same query, it shows my data correct with all the rows that are supposed to be there. So, basically the query works in the plugin, but it’s not working on the page unless the ID is hard coded. Any help is appreciated. Thanks.
SELECT
wp_frm_items.id AS store_id,
MAX(IF(wp_frm_item_metas.field_id = 96, wp_frm_item_metas.meta_value,”)) User_ID,
MAX(IF(wp_frm_item_metas.field_id = 97, wp_frm_item_metas.meta_value,”)) Date,
MAX(IF(wp_frm_item_metas.field_id = 546, wp_frm_item_metas.meta_value,”)) Day
FROM wp_frm_items, wp_frm_item_metas
WHERE wp_frm_items.id = wp_frm_item_metas.item_id
AND wp_frm_items.user_id = ‘<?php $_GET[ID] ?>’
AND wp_frm_item_metas.field_id IN (96, 97, 546)
GROUP BY wp_frm_items.id
ORDER BY Date DESC;
- The topic ‘Variable in URL not working to display data correctly on a page’ is closed to new replies.