Home > Backend Development > PHP Tutorial > An automatic auction bidding program_PHP tutorial

An automatic auction bidding program_PHP tutorial

WBOY
Release: 2016-07-20 11:08:57
Original
1638 people have browsed it

After the user submits his or her information, it is saved in the database tutorial. Each time the program reads the current result, it must be judged. For example, the user can set how many seconds to participate in the auction, how many times to bid, and how many times in front of it can be set. I only participate in the auction after people bid. They are all humanized functions //Automatic bidding

function auto($second,$gid,$shutuid)
{
global $table_prefix;
//Get 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 ']]))
{
$uumber[$rows['uid']]++;
}
else
                                                                                                                ]] = 0; .$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;
                                                                                                                  !in_array($rows['uid'],$shutuid) && $rows['maxnumber']<=$maxnumber && $rows['number']>$unumber[$rows['uid']]) / /Includes time, and is not in the blacklist, and matches the bidding number setting of this member
                                                🎜> $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;
}


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/444827.htmlTechArticleAfter the user submits his or her information, it is saved in the database tutorial. The program must judge each time it reads the current result. Once, for example, the user can set how many seconds to participate in the auction, how many times to bid,...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template