This is what I have right now
"INSERT INTO `table`(`count`, `time`) VALUES ('1','$datetime')\
ON DUPLICATE KEY UPDATE count=count+1";
Everything works great but I'm trying to limit to how much count can increase by. For example, that script should run until count is at 5 then it should produce an error instead. How can I achieve this?