|
![](/images/resource/spacer.gif) |
|
รบกวนสอบถามครับ จะดึงข้อมูลจากฐานข้อมูลมาเป็นรูปแบบอารเรย์แบบนี้ต้องเขียนอย่างไรครับ |
|
![](/images/resource/viewboard_01.gif?v=1001) |
|
|
![](/images/resource/viewboard_03.gif?v=1001) |
![](/images/resource/viewboard_04.gif?v=1001) |
|
รบกวนสอบถามครับ จะดึงข้อมูลจากฐานข้อมูลมาเป็นรูปแบบอารเรย์แบบนี้ต้องเขียนอย่างไรครับ
Code (PHP)
$content=null;
while($rowtime = mysqli_fetch_array($sqltime)){
$content .= $rowtime[0];
while($rowproduct = mysqli_fetch_array($sqlproduct)){
$content .= $rowproduct [0];
while($rowqty= mysqli_fetch_array($sqlqty)){
$content .= $rowqty[0].$rowqty[1];
}
}
}
Code (PHP)
$fruits = array ("2020-09-24 14:21:22"=> array ("Product1" =>array ("100",
"10"),
"Product2" =>array ("100",
"10")),
"2020-09-25 14:21:23"=> array ("Product3" =>array ("100",
"10"),
"Product4" =>array ("100",
"10")),
"2020-09-26 14:21:23"=> array ("Product5" =>array ("100",
"10"),
"Product6" =>array ("100",
"10")));
Tag : PHP, MySQL
![](/images/adv.jpg?v=1001)
|
ประวัติการแก้ไข 2020-09-24 16:49:42
|
![](/images/resource/blockviewtopic_01.gif?v=1001) |
![](/images/resource/blockviewtopic_02.gif?v=1001) |
![](/images/resource/blockviewtopic_03.gif?v=1001) |
![](/images/resource/blockviewtopic_04.gif?v=1001) |
Date :
2020-09-24 16:48:42 |
By :
nonkungzacb |
View :
614 |
Reply :
2 |
|
![](/images/resource/blockviewtopic_06.gif?v=1001) |
![](/images/resource/blockviewtopic_07.gif?v=1001) |
![](/images/resource/blockviewtopic_08.gif?v=1001) |
![](/images/resource/blockviewtopic_09.gif?v=1001) |
|
|
|
![](/images/resource/viewboard_06.gif?v=1001) |
![](/images/resource/viewboard_07.gif?v=1001) |
|
![](/images/resource/viewboard_08.jpg?v=1001) |
![](/images/resource/viewboard_09.gif?v=1001) |
![](/images/resource/viewboard_01.gif?v=1001) |
|
|
![](/images/resource/viewboard_03.gif?v=1001) |
![](/images/resource/viewboard_04.gif?v=1001) |
|
ขอบคุณครับ
|
![](/images/resource/blockviewtopic_01.gif?v=1001) |
![](/images/resource/blockviewtopic_02.gif?v=1001) |
![](/images/resource/blockviewtopic_03.gif?v=1001) |
![](/images/resource/blockviewtopic_04.gif?v=1001) |
Date :
2020-09-25 08:49:50 |
By :
nonkungzacb |
|
![](/images/resource/blockviewtopic_06.gif?v=1001) |
![](/images/resource/blockviewtopic_07.gif?v=1001) |
![](/images/resource/blockviewtopic_08.gif?v=1001) |
![](/images/resource/blockviewtopic_09.gif?v=1001) |
|
|
![](/images/resource/viewboard_06.gif?v=1001) |
![](/images/resource/viewboard_07.gif?v=1001) |
|
![](/images/resource/viewboard_08.jpg?v=1001) |
![](/images/resource/viewboard_09.gif?v=1001) |
|
|
|
![](/images/digitalocean-banner.jpg)
|
Load balance : Server 03
|