php - PHP循环一个队列数据,并在第一个可见子DIV处输出当前队列号
问题描述
我有一个表名queue
,我正在使用 PHP 来获取所有队列数据,数据库中有 9 条数据记录。
$qid = 20;
$fetchall = DB::fetch_all("SELECT * FROM ....");//discuz template language, = mysqli_fetch_all
foreach($fetchall as $ft){
//some other code here
$flist[] = $ft;
}
示例:在上述之后query
,我有18,19,20,21,22,23,24,25,26
. 现在我当前的队列号码是20
,所以我希望号码20
显示在 DIV 的第一个号码,下图是我想在网页中显示的内容。
<div id="parent" style="width:100px">
<div id="child">
<!--I'm using discuz template language to loop $flist here-->
<div>18</div><!--hidden-->
<div>19</div><!--hidden-->
<div>20</div><!--show this at the first left-->
<div>21</div><!--show this if parent width enough, else hidden-->
<div>22</div><!--show this if parent width enough, else hidden-->
<div>23</div><!--show this if parent width enough, else hidden-->
<div>24</div><!--show this if parent width enough, else hidden-->
<div>25</div><!--show this if parent width enough, else hidden-->
<div>26</div><!--show this if parent width enough, else hidden-->
</div>
</div>
由于18
and19
小于20
,所以让它们在父 DIV 的外侧。
解决方案
推荐阅读
- powershell - Powershell Select-String -ExactMatch?
- html - Django Crispy Forms 不显示某个字段的边框
- flutter - 找不到正确的提供者
高于此消费者 小部件 - mule-studio - Unable to resolve reference to Class loaded via External library
- visual-studio - Visual Studio 中的 CMake 设置问题
- ruby-on-rails - 浏览器中的 Rails API 路径给出此错误 NoMethodError undefined method `[]' for nil:NilClass
- sql - Power Bi SQL - 不支持语义查询
- amazon-web-services - 如何使用Lamda函数在RDS中使用CDK创建表?
- functional-programming - 如何正确使用 Result.bind
- java - 根据JAVA列表内对象的属性将新对象添加到对象列表中