时间:2021-07-01 10:21:17 帮助过:19人阅读
这里我已得出这个表的总行数 $sql = "select count(*) from".$db_table; $exec = mysql_fetch_array($con); $allgoods = $exec[0]; //总行数 $sql = "update `".$db_table."' set cs = '".rand($summin,$summax)."' ";//更新语句
for ($i=0;$i<=$allgoods;$i++){ $sql = "update `".$db_table."' set cs= '".rand($summin,$summax)."' where id = '".$i."'"; query.... }
$sql = "select id from ".$db_table; $result = mysql_query($sql,$con); while($row=mysql_fetch_object($result)){ $id=$row->id; echo $id."
"; }