$ query = "select * from where where subject = '". $ subject. "' and type = '". $ type. "' ORDER BY message_id desc LIMIT $ limit, $ per_page";

This query does not sort records by unique index. Why? If I remove LIMIT, then everything is fine

  • insert the result in the question <? var_dump ($ query); ?> - Sh4dow 1:43 pm
  • helped saw an error - passed the incorrect page number $ page - olegmar

1 answer 1

  1. What is in $ limit and $ per_page?
  2. what is in $ subject? If this is a numeric field, then everything is ok. If string - then the request will not work.
  3. Similar to clause 2, only with $ type
  • Thank. Wrong was $ page - olegmar