I'm tracking challenges for a video game. There are 4 daily challenges and 1 weekly challenge. They update at 3am PST. I have a cron job that runs at 5 after to make sure the new information is in the API before I make the request, and I store the challenges in a table in the database, with an id. If the challenge is already present in the table, I don't insert it again, I just get the existing row's id. I have another table that contains the timestamp for when the challenge became active, theexpiration timestamp, and 4 columns for the 4 id's (and the same for weekly except one column for the id). Since challenges are reused, I'd like to be able to see what other days a given challenge was used for, currently I'm using this query, and I'm not happy with it:
Where # is the id of a certain challenge. Weekly challenges are never reused, so I ignore them. Anyway, this works, but it's just so clunky. I was reading about FULLTEXT searches and was wondering if I could do something similar with this. I know FULLTEXT can't be used on integer columns, but is there anything equivalent?
Much obliged.
Code:
SELECT date FROM `current_daily` WHERE daily1 = # OR daily2 = # OR daily3 = # OR daily4 = # ORDER BY date ASC
Much obliged.
Comment