显示两个数字之间的值 [英] Display value between two numbers
本文介绍了显示两个数字之间的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的 MySQL 表中有一个名为month"和month2"的列,month 列的值为11",month2 列的值为15".是否可以显示月 (11) 和月 2 (15) 之间的值?我说的是显示数字 12,13 和 14.谢谢!
Hi I have a column in my table in MySQL named "month" and "month2", the month column has a value of "11" and month2 column has a value of "15". Is it possible to display the values between month (11) and month2 (15) ? I'm talking about displaying numbers 12,13 and 14. Thanks!
如果数字 12、13、14 在搜索字段中会怎样?例如用户搜索第 14 天,而 14 是在月(11)和月 2(15)之间??
What if the numbers 12,13,14 are in a search field? for example the user search for day 14, and 14 is between month(11) and month2(15)??
推荐答案
foreach(range($month1 + 1, $month2 - 1) as $month) {
echo $month;
}
未经测试,需要一些错误检查,但可以完成工作.
Untested, and need some error checking, but may do the job.
这篇关于显示两个数字之间的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文