Symbianize Forum

Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.

All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!

Mga PROgrammers. Patulong po sa Random Function

xXxGrimmmMxXx

Apprentice
Advanced Member
Messages
61
Reaction score
2
Points
28
Para po sa CAPSTONE ko.

Mam/Ser patulong po sa randomization. Eto po yung current algorithm ko. Yung kukuha po ng random row sa db pero naka-depende po sa "availability" ng data. Php gamit ko.

1. USER1(vendor) INSERTS DATA(items).
by default, may `itemID` sya, may `userID`, `availability` is 'open'.

2. Randomly, yung system** kukuha ng 10 items for every user at yung availability na yun magpapalit into 'selling'.
**Either timely or every click ng USER2(admin) sa isang button.

3. Pag-click ulit ng admin nung button, kukuha ulet ng bagong batch. PERO yung mga 'selling' na items before ay papalit into 'cooldown'.

4. Another click ng admin, same happens sa mga susunod na batch. Pero yung 'cooldown' na yun, babalik na ulit sa 'open'

Possible ba to? If may idea kayo na mas madali. Open po ako sa suggestions.

- - - Updated - - -

Sana mapansin

- - - Updated - - -

Up ko lang po baka may makatulong.

- - - Updated - - -

Up up up up
 
Last edited:
1. query random items -> lagay mo din to sa temp table (for reference)
2. query again random items -> get data on the temp table and update their status
.. same process again and again..

dapat ay temp table ka para may reference ka sa previous items na na rendomly selected after admin click.
 
Back
Top Bottom