Ok, I have two tables that I am joining and doing a select on to get three fields back (timestamp, message, and articleNum). Now, this data is basically a log of when an article was created and modified, I have to write the logic to process those three fields I got back. In order to figure out when an article was created and/or modified last, I need to look at the message and look for the keywords ("added" for created and "updated" for modified). I have the results of the query back in an assoc array and I would eventually like to have the end result be in an assoc array with the articleNum being the key and a two value array (created, modified) being the key. Sometimes though, there won't always be a modified value, but there will always be a created. Any idea on how I would even start a problem like this?
EDIT From what I can tell, it looks like the date is stored as a bigint in Unix seconds. Clarification: the created and modified values are not fields from the table, I need to figure it out from the message field. There will always be one added time but sometimes there could be 0 or more updated messages and I would need to figure out the latest.
EDIT 2 Ok, sorry about the wording of the question. After looking at the problem a little longer I realized I could do this all in two SQL statements. For finding the added date I used:
"SELECT MIN(action_logs.time_added), article.number
FROM action_logs
JOIN proposal ON action_logs.article_num = article.number
WHERE action_logs.message LIKE '%added%'
GROUP BY article.number"
Could probably do the same thing for last modified, except with a MAX. Thanks for the suggestions though.