[Mysql 5] Receiving multiple of 12 from database
Hello I have a problem which is very hard I suppose. I need to get a multiple of 12 of records from the database.
I do a query and then add 12 empty records ( UNION all NULLS) to the result to make sure it is possible.
But now the hardest part is to get a multiple of 12 back exactly. Limit 12 works, but when there are 13 normal items I need back 24 records. So that does not work with limit. I have made a secondary query which counts the number of multiples of 12 I need (Select (count(*) div 12) +1 as nrofpages from table) and wanted to multiply that with 12 and use that as the limit expression, but the only problem is that the LIMIT statement does not allow querys or any kind of math functions, it just requires a plain integer.
So does anyone here have any idea?
Thanks in advance