twebman Posted August 21, 2006 Share Posted August 21, 2006 I have a "This Day in Baseball History" database. The fields are:id, content, day, month, yearThe 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. Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted August 21, 2006 Share Posted August 21, 2006 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. Quote Link to comment Share on other sites More sharing options...
theblain Posted August 21, 2006 Share Posted August 21, 2006 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 Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted August 21, 2006 Share Posted August 21, 2006 why store all that extra data when its not needed? Quote Link to comment Share on other sites More sharing options...
twebman Posted August 21, 2006 Author Share Posted August 21, 2006 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! Quote Link to comment Share on other sites More sharing options...
syed Posted August 22, 2006 Share Posted August 22, 2006 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> Quote Link to comment Share on other sites More sharing options...
syed Posted August 22, 2006 Share Posted August 22, 2006 Sorry guys, I dont know how I did it, but I replied to the wrong thread. Sorry. ::) Quote Link to comment 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.