An automatic bidding program. After you submit your own information, save it in the database tutorial. each time the program reads the current result, it must judge the number of times. for example, you can set the number of times of bidding and bidding in seconds, after you submit your own information, save it in the database tutorial. each time the program reads the current result, it must judge the number of times. for example, you can set the number of times of bidding and bidding in seconds, in addition, you can set the number of people in front of the competition before I participate, all are some user-friendly features // automatic bidding
Function auto ($ second, $ gid, $ shutuid)
{
Global $ table_prefix;
// Retrieve the number of bids for this product
$ Maxnumber = 0;
$ Unumber = array ();
$ Query = mysql tutorial _ query ("select id, uid from" '. $ table_prefix. "buylog 'Where gid =". $ gid );
While ($ rows = mysql_fetch_assoc ($ query ))
{
$ Maxnumber ++;
If (isset ($ unumber [$ rows ['uid'])
{
$ Unumber [$ rows ['uid'] ++;
}
Else
{
$ Unumber [$ rows ['uid'] = 0;
}
}
// Retrieve the automatically auctioned members
$ SQL = "select uid, username, number, second, maxnumber, gid, ip from" '. $ table_prefix. "autobuy 'Where gid =". $ gid;
$ Query = mysql_query ($ SQL );
$ Allow = array ();
$ Shutuid = explode (',', $ shutuid );
While ($ rows = mysql_fetch_assoc ($ query ))
{
$ Seconds = explode (',', $ rows ['second']);
$ Unumber [$ rows ['uid'] = isset ($ unumber [$ rows ['uid'])? $ Unumber [$ rows ['uid']: 0;
If (in_array ($ second, $ seconds )&&! In_array ($ rows ['uid'], $ shutuid) & $ rows ['maxnumber'] <= $ maxnumber & $ rows ['Number']> $ unumber [$ rows ['uid']) // contains time, this parameter is not in the blacklist and meets the bid setting of this member.
{
$ Allow [] = $ rows ['uid'];
}
}
$ Allowuser = array ();
If ($ allow)
{
$ Query = mysql_query ('select uid, username, money, ip from ''. $ table_prefix. 'user' where uid in ('. implode (',', $ allow ). ')');
While ($ rows = mysql_fetch_assoc ($ query ))
{
$ Allowuser [] = $ rows;
}
}
Unset ($ allow, $ SQL, $ number, $ maxnumber, $ shutuid, $ query, $ u );
Return $ allowuser;
}
Success ,...