我使用const newDate = '2019-06-22'
this.setState(({pressedDate}) => ({
pressedDate: {
...pressedDate,
[newDate] :
{
dots: [vacation, massage, workout], selected: true
}
},
}))
result_array()
但是,当我使用循环进行打印/回显时,这将返回空白/未打印
public function genJam($id_hari){
$query = $this->db->query("SELECT jam FROM mharijam WHERE hari=$id_hari ORDER BY jam");
return $query->result_array();
}
请帮助我,谢谢
答案 0 :(得分:0)
您是否知道要一遍又一遍地调用该函数?
$result = $this->genJam(1);
$count = count($result);
if($count)
{
for($i=0; $i < $count; $i++)
{
//$childCount = count($result[$i]);
//for($j=0; $j < $childCount; $j++)
//{
print_r($result[$i]['jam']);
echo "\n";
//}
}
}