Rounding up results

Is there a way to round up in mySQL? This result may give 3.2 --- so I
want the result to be 4?

SELECT ( count(`reference`) / $items_per_page ) AS total_pages FROM
`store_product_profile` WHERE `store_category_reference` =$reference AND
`live` =1


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
ron.piggott [ Di, 09 März 2010 11:32 ] [ ID #2034475 ]

Re: Rounding up results

Ron Piggott wrote:

> Is there a way to round up in mySQL? This result may give 3.2 --- so I
> want the result to be 4?
>
> SELECT ( count(`reference`) / $items_per_page ) AS total_pages FROM
> `store_product_profile` WHERE `store_category_reference` =$reference AND
> `live` =1

Does your location not let you access the mysql documentation?

http://dev.mysql.com/doc/refman/5.1/en/mathematical-function s.html


Cheers
--
David Robley

<CTRL>-<ALT>-<DEL> is the key to success
Today is Pungenday, the 68th day of Chaos in the YOLD 3176.


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
David Robley [ Di, 09 März 2010 13:06 ] [ ID #2034476 ]
PHP » gmane.comp.php.database » Rounding up results

Vorheriges Thema: RegExp
Nächstes Thema: Upgrading PHP Version 5.1.6