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
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.

Link to comment
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.