Hello everyone i would like to ask you why, when i put limit 0,5 and 5,10 it does not work correctly here is my code.
$sql = mysql_query("SELECT * FROM vn_questions WHERE published = 1 limit 0,5 ");
while($data=mysql_fetch_array($sql))
{
echo $data['author'];
}
it gives me 5 results but when i put
$sql = mysql_query("SELECT * FROM vn_questions WHERE published = 1 limit 5,10 ");
while($data=mysql_fetch_array($sql))
{
echo $data['author'];
}
it gives me 6 .. where is the problem and how Can i fix it? I tried +1 -1 but the output is not working correctly.
5-6-7-8-9-10 = "6"instances.0is none, then you start counting up to 5 = 5 --- What is your expected result?LIMITout, or drop the first number. I.e.:LIMIT 10and that will give you 10 results. Oh, and my comment comment, that was "in a nutshell" ;-)