Im officially hating php/mysql at the moment. I spent today working on my website. I have a new section where you select what item you have lost then it will tell you when you last had it. This is grand but i also want it to show what other items you had at this time. It doesnt make sense just comparing by datestamp cos this will compare it exactly by second, so im using a select query which will find items which have the same hour and minute as the lost item. The problem comes with setting the hour and minute as being the same as those in the data entry corresponding to the lost item. Confused? Thats ok my brain is mush so im stopping for the day.
Also started my wiki editing which I'll be working on over the week. Heres the link for those interested https://trac.ucd.ie/wiki/GumstixRFID
Update: I've managed to fix this problem. It was annoying me so much I had to go back and work on it. I realised I could just take the timestamp field gotten from the query which returns the last occurance of lost item, and set it as a variable. Then I could just take characters at certain points in the string and set these as new variables corresponding to hour and minute. I can pass these into the query which selects other objects that the user had at this time. The timestamp is always in the same format so its ok to explicitly state what characters are taken from the string. Probably not the most elegant code but hey it works
Wednesday, January 16, 2008
Subscribe to:
Post Comments (Atom)
1 comment:
> Probably not the most elegant code but hey it works
that's the spirit. Now put a comment in your code that describes that issue and maybe later you'll come back to it. (of course you might not need to, the String should always be the same format.)
Post a Comment