I have two fields in my database that simply store on and off times for my application. I need to make sure that the off time is not greater than the on time. I believe that a trigger may be good but I have never written one before. Can someone either verify that a trigger is the way to go or maybe writing some PHP code to handle this would be better... Any suggestions or trigger snippets are welcome.
I'm storing the on off times which are the user's preferences. If I could get the database to return false or maybe through my PHP code, I could test for a return value and then handle it accordingly.