An automatic bidding package-PHP Tutorial

Source: Internet
Author: User
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 ,...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.