do while is breaking. How to skip rows PHP
Posted
by Victor
on Stack Overflow
See other posts from Stack Overflow
or by Victor
Published on 2010-06-15T13:39:03Z
Indexed on
2010/06/15
13:42 UTC
Read the original article
Hit count: 365
Hello all. I have a question probably lame but it made me stuck I have the a db query
$query_Recordset10 = "SELECT * FROM products WHERE razdel='mix' AND ID='$ID+1' AND litraj='$litri' ORDER BY ID ASC";
$Recordset10 = mysql_query($query_Recordset10, $victor) or die(mysql_error());
$row_Recordset10 = mysql_fetch_array($Recordset10);
$totalRows_Recordset10 = mysql_num_rows($Recordset10);
I have do while loop in my page and the idea i to show products matching this criteria. But if the next product is 2 or more ID's ahead my cycle breaks. So is there a way for skipping this row and get the next ID matching the criteria.
Thank you very much.
© Stack Overflow or respective owner