代码
mysql记录中当前行号
$exec=mysql_query("Select articleid,(@rowNum:=@rowNum+1) as rowNo From product,
(Select (@rowNum :=0) ) b where bigclassid='$r_bigclassid' Order by product.product_id");
$rows=mysql_num_rows($exec);
$rs=mysql_fetch_array($exec);
do {
if($rs['articleid']==$articleid)
{
$inum=$rs['rowNo'];
}
}
while ($rs = @mysql_fetch_array($exec));
$current_num=$inum-1;
$exec=mysql_query("Select articleid,(@rowNum:=@rowNum+1) as rowNo From product,
(Select (@rowNum :=0) ) b where bigclassid='$r_bigclassid' Order by product.product_id");
$rows=mysql_num_rows($exec);
$rs=mysql_fetch_array($exec);
do {
if($rs['articleid']==$articleid)
{
$inum=$rs['rowNo'];
}
}
while ($rs = @mysql_fetch_array($exec));
$current_num=$inum-1;