in this statement: How can I make "y" the total number of all rows, so that mysql selects all rows from x to the end of the table? .
Above is correct. buy it would exclude x and the original author wants x included Try $x = $x-1; select * from table where id>$x not perfect but right now it will work for you. You cna do it in pure SQL if you can be bothered but the milisecond performance increase isnt worth it
Actually, in a DB, the rows are not stored in any particular order. So unless you are sorting the results based on some field, there are no "last x rows" in a table.
or you can use numrows, then you will know how many records there are: $query = "SELECT * FROM mytable ORDER BY whatever" //order by will make sure you get the same results every time $result = @mysql_query ($query); $numrows = mysql_num_rows($result); '$numrows' then contains the number of rows in the table.