This maybe off base, but I think the reason that the items are getting deleted is because the expdate field should be set to the current time, in UNIX_TIMESTAMP format, + the number of seconds you want to retain it. Setting it to 0, as in the examples, will result in the code deleting the rows because of the condition.
Are you trying to create infinite timeouts ? If so then this would be a simple fix to the SQL, just with an expansion on the condition so that it read;
where (expdate < UNIX_TIMESTAMP() and expdate != 0)
This would allow for expdate=0 to be inifinite, assuming its just the timeout that is at fault.
|