the query 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
            15:12 UTC
        
        
        Read the original article
        Hit count: 474
        
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);
This is the query for the next product in the line based in the ID of the current product thats on the page.
But if the next product matching the criteria in the query is 2 or more ID's ahead my cycle breaks. So is there a way for skipping this rows and get the next ID matching the criteria.
Thank you very much.
© Stack Overflow or respective owner