I need to test current time against a datetime from database, if it has been 30 mins then execute code, if not then dont. This is where I am at and I am stuck:
SELECT id FROM dwCache ORDER BY id DESC LIMIT 1
you'll get only id field, it's the first. The second, for time converting: MySQL convert datetime to Unix timestamp
id
Third: you can convert your time string using strtotime function.
strtotime