cosmicsea Posted May 31, 2010 Share Posted May 31, 2010 Hi im trying to make a keyword tag cloud that is basically showing daily trends. I need some help with the query. I am not sure how to do this. I want the keywords by total_searches and only for the specific day to show. can anyone help me. this is what im using now and it displays top keywords. $tmp_query = "select * from keyword_list order by total_searches desc limit {$limit}"; Quote Link to comment https://forums.phpfreaks.com/topic/203441-sql-query-help/ Share on other sites More sharing options...
ohdang888 Posted May 31, 2010 Share Posted May 31, 2010 you need a WHERE clause inbetween the SELECT and ORDER that says something like WHERE date=$today Quote Link to comment https://forums.phpfreaks.com/topic/203441-sql-query-help/#findComment-1065797 Share on other sites More sharing options...
cosmicsea Posted May 31, 2010 Author Share Posted May 31, 2010 you need a WHERE clause inbetween the SELECT and ORDER that says something like WHERE date=$today ok thanks Quote Link to comment https://forums.phpfreaks.com/topic/203441-sql-query-help/#findComment-1065883 Share on other sites More sharing options...
cosmicsea Posted May 31, 2010 Author Share Posted May 31, 2010 I need help with one more thing if anyone can help. i have this query right here $tmp_query = "select * from links where display_name like '%{$keyword}%' and host_type = 1 group by group_id order by link_id desc LIMIT {$start},{$limit}"; and im trying to make a filter for host_type but i need it filtered by up to 15, so i need numbers 1 - 15 filtered. when i have it like it is "host_type = 1" it works fine for all data with the 1 but i need it to work for all 15. when i goto search.php?q=query&host_type=1 it shows everything for 1 but i need it to also work for the other individual numbers "1 - 15" also and only pick up the data from 1 - 15. also i need to add in type > 0 somewhere in the query too as a filter but cant figure out how without making errors. can someone help me with these 2 problems? Quote Link to comment https://forums.phpfreaks.com/topic/203441-sql-query-help/#findComment-1065888 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.