Welcome to WebmasterWorld Guest from 54.226.62.251

Forum Moderators: open

Message Too Old, No Replies

multiple queries, random userID from

     

dsat

8:19 am on Aug 28, 2010 (gmt 0)

5+ Year Member



Apologize for my poor English.

I have not been programmed at about 4 years, so I need some help. There is a need to do photo analysis system for educational purposes. To encourage more voting, script chosen random winner, who are voting for at least 15 times a week.

**

I need a script that, chosen random (userID), who are voting for at least 15 times a week.

If there is more than one, script randomly selects a winner (preference to those who have never won).

In this example, according to the winner should show every Monday.

The week starts on Monday at 00:00:00 and ends on Sunday at 23:59:59.

Server: Linux, Apache 2, PHP 5, MySQL 5

table 'ExampleTable'

$StartTime = '2010-11-01'; // Voting begins

$EndTime = '2010-12-05'; // Voting ends

$MinRecord = '15'; // minimal records in the last seven days (week) of the table "ExampleTable"

$MaxWin = '1'; // max winner of the week.


table 'Votings'

VoteID (INT)
GalleryID (INT)
PictureID (INT)
UserID (INT)
Voting (TINYINT)
VoteTime (DATETIME)

table 'winners'

winID
galleryID
userID
winnerDay (DATETIME)

dsat

8:22 am on Aug 28, 2010 (gmt 0)

5+ Year Member



before was wrong table name in comment

$MinRecord = '15'; // minimal records in the last seven days (week) of the table "Votings"
 

Featured Threads

Hot Threads This Week

Hot Threads This Month