0
所以我有一个查询需要6次(这些可以是空白的,所以应该忽略)从数据库中,我想循环遍历结果并挑出其中的一个的时间,并按照升序排列。到目前为止,我并没有在试图回显这段代码时得到结果。通过mysql循环结果并创建唯一时间数组
$rndQuery=$this->DB->prepare("select time1, time2, time3, time4, time5, time6
from customers
where customer_cycle_uid=".$this->DB->quote_smart($cycleRow['uid'])."
and customer_uid=".$this->DB->quote_smart($customerRow['uid'])."
and (blistered='1')
and (prn!='1')");
$rndResult=$this->DB->query($rndQuery);
$rndCount=$this->DB->numRows($rndResult);
$rounds = array();
while($rndRow=$this->DB->fetchArray($rndResult))
{
$rounds = array_merge($rounds, array_unique(array_filter($rndRow)));
}
$rvalues = array_values($rounds);
我试图用的时间,例如,0700,1200,1500,1800的阵列,以结束,2200。应当注意,如果有多于6周不同的时间,这将创造超过6个阵列实体。
人?可悲的是,我需要这个快速 – Aaron
你愿意给你一个超过6个元素的数组吗? –
我希望它给我什么是在数据库中,客户条目有time1-time6每个这些可能是不同的所有照顾我只需要在数组中的每一个 – Aaron