I have a MySQL table having many rows and my question is,
How to
i) Display rows from MySQL table as the row length is equal to multiples of 3
ii) In other case if row count not equal to multiples of 3 then display the row equal to nearest multiples of 3 for example, if the row length is 5 then display only first 3 rows.
for more clarification,
- If mysql_num_rows = 3, display all three rows.
- If mysql_num_rows = 5, display any three rows.
- If mysql_num_rows = 11, display any nine rows.