Sunday 15 May 2011

php - Laravel/Eloquent - 15 Second Interval between timestamp -


The user is trying to stop posting comments very quickly, so the plan is to use a 15 second interval .

This query is not working to see if any comment was made in the last 15 seconds. What am i doing

Table:

  id | Comment | Made_at | =============================================== | Blah kad 2013-06-20 18:14:17 |   

However, I can not take enough to work with this lucrative

  // Are they commenting very fast? ('User_id', '=', $ userid) - & gt; Where ('created_at', '<', '(now,), INTERVAL $ 15 $ security = DB :: table (' comments') -> 2) - & gt; get (); If (! Empty ($ security)) {return direct :: back () - & gt; Along with the message ('Please wait 15 seconds between comments.', 'Error'); }    

Try changing

  - & Gt; ('Created', '<', '(NOW (), INTERVAL 15 seconds)')   

  - & gt; Where ('  

I hope this can be helpful. < / P>

No comments:

Post a Comment