Jump to content

Archived

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

twebman

This Day in History database retrieval

Recommended Posts

I have a "This Day in Baseball History" database. The fields are:

id, content, day, month, year

The content field holds the descrip of what happened that day. The other fields are self-explanatory. I want to add a field that will tag each event to a certain team, so I can display the results to have a "this Day in Tigers History" page and "Yankees" and so on... Some events might be fit more than one team. How can I create a field that has an identifier for both teams? For example, if it's an event I want to have on both the Tigers and Yankees pages, can I put "DET" and "NYY" in one field separated by a space? How do I retrieve it? I've tried LIKE and CONTAINS and neither works. Is there a way to do it that I'm overlooking?

Any help is appreciated.

Share this post


Link to post
Share on other sites
I personally would have a separate table with just two fields team_id and event_id.

then you can use an inner join to match up the events and the teams while keeping the database manageable.

Share this post


Link to post
Share on other sites
I'm sure this isn't the BEST way of doing this, but you COULD create a couple "search" fields like keyword1 keyword2 keyword3, then "this day" would have to do with keyword 1 = giants keyword 2 = yankees..etc...

This would be a work around until someone who knows what they're talking about replies.

-theblain

Share this post


Link to post
Share on other sites
Thanks, ToonMariner... Will try that method. I've done a few INNER JOIN queries and I'll see if I can get this one to work.

THANKS!

Share this post


Link to post
Share on other sites
Would using javascript be a problem, you could have the 404 page redirect to the page you want, by adding the .html at the end of it. What I mean is get the url.


<SCRIPT LANGUAGE="JavaScript">

window.location="http://www.yourdomain.com<?php print $_SERVER['REDIRECT_URL']; ?>.html";
</script>

Share this post


Link to post
Share on other sites
Sorry guys, I dont know how I did it, but I replied to the wrong thread. Sorry.  ::)

Share this post


Link to post
Share on other sites

×

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.