Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何选择最接近的整数,这比你得到的值大?如何按要求制作?
怎么样
SELECT * FROM yourTable WHERE yourColumn > yourInt ORDER BY yourColumn LIMIT 1
这将选择你的第一个更大的数字
我认为以下内容适用于正整数:
$next_num = intval($your_num) + 1;
PHP的ceil()函数应该为你做这个
ceil()
http://php.net/manual/en/function.ceil.php