foreach ออกมาประกบกันค่าไม่ออก.. T^T

สำหรับผู้ที่ เริ่มต้น Programming - PHP มีอะไร แนะนำ หรือข้อสงสัยต้องบอร์ด นี้ คนที่มีความรู้ แบ่งปันคนอื่นบ้างนะ ปัญหาการเขียนโปรแกรม แบบ OOP Session Cookies php network

Moderators: mindphp, ผู้ดูแลกระดาน

User avatar
thatsawan
PHP VIP Members
PHP VIP Members
Posts: 27274
Joined: 31/03/2014 10:02 am
Contact:

foreach ออกมาประกบกันค่าไม่ออก.. T^T

Post by thatsawan »

Code: Select all

 print_r($v_column); echo '<br>'; 
posts
days
warnings
user_online_time

Code: Select all

print_r($value_a); echo '<br>'; 
0
4
0
690

Code: Select all

 print_r($row_tmp);echo '<br>';
Array ( [48] => Array ( [user_id] => 48 [user_posts] => 0 [user_warnings] => 0 [user_online_time] => 690 [user_regdate] => 4 ) )


Code: Select all

 print_r($row_tmp[$key_tmp][$v_column]); echo '<br>';
690

690
**** ทำไม มันมา 690 ฟิลด์เดียว!!! ****

[code=php] foreach ($group_data as $key  => $value) {
                               // print_r($group_data);
                                foreach ($value as $data_groups) {
                                       // print_r($row_tmp);
                                        foreach ($row_tmp as $key_tmp => $value_tmp) {
                                                foreach ($value_tmp as $data_tmp) {
                                                        foreach ($check as $v_column => $value_a) {
//                                                     
                                                                $column_max_key = 'group_max_'.$v_column;
                                                                $column_min_key = 'group_min_'.$v_column;
                                                            
                                                                 print_r($row_tmp[$key_tmp][$v_column]); echo '<br>';
                                                               
                                                        }
                                                                 
                                                }          
                                        }
                                }    
                        } [/code]
User avatar
thatsawan
PHP VIP Members
PHP VIP Members
Posts: 27274
Joined: 31/03/2014 10:02 am
Contact:

Re: foreach ออกมาประกบกันค่าไม่ออก.. T^T

Post by thatsawan »

print_r($row_tmp[$key_tmp][$v_column]); echo '<br>';
จะให้มัน ได้
0
4
0
690

เเต่ทำไม มันได้ 690
User avatar
thatsawan
PHP VIP Members
PHP VIP Members
Posts: 27274
Joined: 31/03/2014 10:02 am
Contact:

Re: foreach ออกมาประกบกันค่าไม่ออก.. T^T

Post by thatsawan »

Code: Select all

  print_r($row_tmp[$key_tmp]); echo '<br>'; 
Array ( [user_id] => 48 [user_posts] => 0 [user_warnings] => 0 [user_online_time] => 690 [user_regdate] => 4 )

Code: Select all

    print_r([$v_column]); echo '<br>';

Array ( [0] => posts )
Array ( [0] => days )
Array ( [0] => warnings )
Array ( [0] => user_online_time )

Code: Select all

   print_r($row_tmp[$key_tmp][$v_column].'>='.$value[$column_min_key]); echo '<br>';
                                                                        print_r($row_tmp[$key_tmp][$v_column].'<='.$value[$column_max_key]); echo '<br>'; 
>=0
<=0
>=100000
<=0
>=0
<=0
690>=0
690<=0
>=0
<=0
>=100000
<=0
>=0
<=0
690>=0
690<=0
>=0
<=0
>=100000
Post Reply
  • Similar Topics
    Replies
    Views
    Last post

Return to “Programming - PHP”

Who is online

Users browsing this forum: No registered users and 18 guests