Hello, help deal with the request.

$queryString = "SELECT id, Name, whoUpload, link, likes, comments, date, time FROM table LIMIT '$start', '$how' WHERE whoUpload = '{$_POST['username']}' ORDER BY `id` DESC"; 

To put it in human language: Start me by displaying records from $start in the amount of $how pieces of User and so fresh in the beginning.

Actually, before LIMIT '$start', '$how' everything worked. Where I just did not try to shove it, maybe you need something different?

  • one
    Is there any hidden meaning to make the date and time columns instead of a single datetime ? And why do you have "fresh" it means with the last inserted IDs, and not in time? - Alexey Shimansky
  • Because I'm still very green: D And why you can't judge the freshness of the recording by id?) - Ivan Blohin
  • one
    It is possible, if there is no date ... And if there are fields with a date, then, for example, you can easily insert records with a date less than at the beginning of the table than at the beginning (for various reasons this can be) ...... and then it will turn out , you want to pull out all the new comments added, and instead you pull out the old stuff. - Alexey Shimansky
  • @ Alexey Shimansky in our table is not relevant, but thank you very much for the clarification :) - Ivan Blohin

1 answer 1

The limit should be at the end.

 SELECT `id`, `Name`, `whoUpload`, `link`, `likes`, `comments`, `date`, `time` FROM table WHERE whoUpload = '{$_POST['username']}' ORDER BY `id` DESC LIMIT '$start', '$how' 
  • 2
    Fresh - doesn’t mean with the biggest ID ... - Alexey Shimansky
  • one
    @ AlekseyShimansky agrees but the answer is basically correct - Naumov
  • Agree id does not always match the most recent entries. But the purpose of the fields is unknown to us. Not the fact that date and time is the time to insert or update the record. Besides, @Ivan Blohin was initially sorted by id and says that it works, but produces a lot of records. - Arnial