Jump to content

[SOLVED] whats the best way?


ccrevcypsys

Recommended Posts

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:

stuff.gif

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

doc_table          docs_to_region_table          regions_table
---------          --------------------          -------------
keyid    <-------> doc_id                +-----> keyid
doc_type           region_id <-----------+       region
date
title
abstract
etc.

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?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.