ccrevcypsys Posted October 23, 2007 Share Posted October 23, 2007 Heres the scenerio. My users want to be able to post news and events in more regions than just one. It used to have just one drop down menu asking what region that this event or news is happining in. now i need to get that to where they can post it in multipul regions. The way i have done it so far is like this picture: Basically instead of using the regions column i made others for each region. The second part of this problem is that by doing that i have no idea how to wright the code to query it. This is the code for what the original : $region = 4; // set this to the region you want to filter latest news on $region_filter = $region ? "&& (region = $region or region = 6)" : ""; $result_news = mysql_query(" SELECT * FROM newsdocs WHERE doc_type != 3 and doc_type != 4 $region_filter ORDER BY date DESC LIMIT 3 "); somone please help me find a better way or just to use this way? i really need help Link to comment https://forums.phpfreaks.com/topic/74497-solved-whats-the-best-way/ Share on other sites More sharing options...
roopurt18 Posted October 23, 2007 Share Posted October 23, 2007 doc_table docs_to_region_table regions_table --------- -------------------- ------------- keyid <-------> doc_id +-----> keyid doc_type region_id <-----------+ region date title abstract etc. Link to comment https://forums.phpfreaks.com/topic/74497-solved-whats-the-best-way/#findComment-376479 Share on other sites More sharing options...
ccrevcypsys Posted October 23, 2007 Author Share Posted October 23, 2007 im sorry to say i dont really understand how that second table is going to work. Im kindof a noob when it comes to mysql. like i dont know how the docs_to_region_table is going to work. Like for example if i wanted an event in regions 1 3 5 how is it going to be able to post that in the table? Link to comment https://forums.phpfreaks.com/topic/74497-solved-whats-the-best-way/#findComment-376497 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.