[Solved] How to get top five calculations only to appear


Three problems.

  1. ORDER BY dogs.affix LIMIT 5 returns bottom 5 not top. It should be ORDER BY dogs.affix DESC LIMIT 5 to get the top.
  2. affix returns either null or an emprty string and that’s why you are getting the first error. Define this field as int not null default 0 in your database.
  3. $total is not initialized. Assign it to 0 before the loop

1

solved How to get top five calculations only to appear