PHP implementation of MySQL database random rearrangement example
Program code
| The code is as follows |
|
Database connection is not written in here. $s = isset ($_get[' s '])? $_get[' s ']:0; $e = isset ($_get[' e '])? $_get[' E ']:50; $count = 85000; if ($s < $count) { $sql = "SELECT * from table prefix _info where isget =0 order by id desc limit $s, $e"; $query = mysql_query ($sql); while ($rs = Mysql_fetch_array ($query)) { $id = $rs [' id ']; $sss = $rs [' SSS ']; $typeid = $rs [' typeid ']; $isget = $rs [' Isget ']; $sql = "INSERT into table prefix _info_bak (ID, table prefix, typeid,isget) VALUES (' $id ', ' $sss ', ' $typeid ', ' $isget ')"; mysql_query ($sql); Echo $sql; Exit $SQLU = "Update table prefix _info set isget=1 where id =". $rs [' id ']; mysql_query ($SQLU); } Echo ' is working on the data, currently '. $s. ' Bar ... '; } Else { Echo ' completes all data processing and then randomly sorts once '; } ?> |
http://www.bkjia.com/PHPjc/895098.html www.bkjia.com true http://www.bkjia.com/PHPjc/895098.html techarticle PHP Implementation MySQL database random reflow Example program code code is as follows?//database connection is not written here. $s = isset ($_get[' s '])? $_get[' s ']:0; $e = isset ($_get[' e '])? $_get. .