Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Database queue logic

by ruoso (Curate)
on Jun 14, 2005 at 12:20 UTC ( [id://466502]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    -- fetch 10 to avoid querying too many times....
    SELECT * FROM tablex ORDER BY dateofinsertion LIMIT 10;
    -- Mark the register as owned by you
    UPDATE tablex SET controlfield=controlfield+1 WHERE id=$id AND control
    +field=$controlfieldvalue;
    
  2. or download this
    if ($sth->rows) {
        # it did the update, so the row is mine.
    } else {
        # someone else took the register, let's try another one
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://466502]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2024-04-23 16:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found