나눈 여분필드를 리스트화면에 출력시
쪼갠 여분필드관련 해서 문의 드립니다.
연습으로 여분필드를 쪼개서 전화번호를 쪼갠 여분필드에 각각 저장하여
리스트화면에서 불러오는 방식을 해보는 중인데요.
for ($j=0; $j<count($list); $j++) {
$ex2_filed = explode("|",$list[$j][wr_2]);
$ext2_00 = $ex2_filed[0]; //
$ext2_01 = $ex2_filed[1]; //
$ext2_02 = $ex2_filed[2]; //
$ext2_03 = $ex2_filed[3]; //
$ext2_04 = $ex2_filed[4]; //
$ext2_05 = $ex2_filed[5]; //
$ext2_06 = $ex2_filed[6]; //
$ext2_07 = $ex2_filed[7]; //
$ext2_08 = $ex2_filed[8]; //
$ext2_09 = $ex2_filed[9]; //
<? echo $ext2_03 ?>-<? echo $ext2_04 ?>-<? echo $ext2_05 ?>
요렇게 출력하면
저장된대로 011-0000-0000 라고 나옵니다..
그런데
전리스트가 그렇게 나옵니다.
디비 마지막에 저장된 전화번호로 해당 게시판리스트가 쭉 도배되는거죠..
어찌해야 각 디비에있는 각각에 전화번호를 불러올수 있을까요...?
연습으로 여분필드를 쪼개서 전화번호를 쪼갠 여분필드에 각각 저장하여
리스트화면에서 불러오는 방식을 해보는 중인데요.
for ($j=0; $j<count($list); $j++) {
$ex2_filed = explode("|",$list[$j][wr_2]);
$ext2_00 = $ex2_filed[0]; //
$ext2_01 = $ex2_filed[1]; //
$ext2_02 = $ex2_filed[2]; //
$ext2_03 = $ex2_filed[3]; //
$ext2_04 = $ex2_filed[4]; //
$ext2_05 = $ex2_filed[5]; //
$ext2_06 = $ex2_filed[6]; //
$ext2_07 = $ex2_filed[7]; //
$ext2_08 = $ex2_filed[8]; //
$ext2_09 = $ex2_filed[9]; //
<? echo $ext2_03 ?>-<? echo $ext2_04 ?>-<? echo $ext2_05 ?>
요렇게 출력하면
저장된대로 011-0000-0000 라고 나옵니다..
그런데
전리스트가 그렇게 나옵니다.
디비 마지막에 저장된 전화번호로 해당 게시판리스트가 쭉 도배되는거죠..
어찌해야 각 디비에있는 각각에 전화번호를 불러올수 있을까요...?
|
댓글을 작성하시려면 로그인이 필요합니다.
댓글 7개
$ex2_filed = explode("|",$list[$j][wr_2]);
$ext2_00 = $ex2_filed[0]; //
$ext2_01 = $ex2_filed[1]; //
$ext2_02 = $ex2_filed[2]; //
$ext2_03 = $ex2_filed[3]; //
$ext2_04 = $ex2_filed[4]; //
$ext2_05 = $ex2_filed[5]; //
$ext2_06 = $ex2_filed[6]; //
$ext2_07 = $ex2_filed[7]; //
$ext2_08 = $ex2_filed[8]; //
$ext2_09 = $ex2_filed[9]; //
를 넣으시고
출력할 곳에
<?=$ext2_00?><br><?=$ext2_01?> 이런 식으로 해보세요
저도 이거때문에 여러가지 하다가 알게됬다능~
<? echo $ext2_00?><br><? echo $ext2_01?>
는 같지 않나요?? 결과물도 같습니다..
$ext2_00 = $ex2_filed[0]; //
$ext2_01 = $ex2_filed[1]; //
$ext2_02 = $ex2_filed[2]; //
$ext2_03 = $ex2_filed[3]; //
$ext2_04 = $ex2_filed[4]; //
$ext2_05 = $ex2_filed[5]; //
$ext2_06 = $ex2_filed[6]; //
$ext2_07 = $ex2_filed[7]; //
$ext2_08 = $ex2_filed[8]; //
$ext2_09 = $ex2_filed[9]; //
이 부분을 여기에 넣는게 아니구
for 문에는
<?=$ext2_00?> 이 값만 넣는게 아닌가요...
$ex2_filed = explode("|",$list[$j][wr_2]); ~
이 부분들에 대해서는 상단 인쿠르트 쪽에 넣어 보세요.
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// 선택옵션으로 인해 셀합치기가 가변적으로 변함
for ($j=0; $j<count($list); $j++) {
$ex2_filed = explode("|",$list[$j][wr_2]);
$ext2_00 = $ex2_filed[0]; //
$ext2_01 = $ex2_filed[1]; //
$ext2_02 = $ex2_filed[2]; //
$ext2_03 = $ex2_filed[3]; //
$ext2_04 = $ex2_filed[4]; //
$ext2_05 = $ex2_filed[5]; //
$ext2_06 = $ex2_filed[6]; //
$ext2_07 = $ex2_filed[7]; //
$ext2_08 = $ex2_filed[8]; //
$ext2_09 = $ex2_filed[9]; //
?>
이런식으로 된상태구요~!!!!
출력되는 부분에
<td> <? echo $ext2_03 ?><? echo $ext2_04 ?>-<?=$ext2_04?> </td>
이런식으로 하게되면
마지막에 저장된 게시물의 번호로
1 번게시물 010-000-0000
2 번게시물 010-000-0000
3 번게시물 010-000-0000
동일 하게 나와서 문의드렸습니다 ㅠㅠ
리스트 출력하는 for문 다음줄에 $ex2_filed = explode("|",$list[$j][wr_2]); 만 넣고
$ext2_00 =
~
~
$ext2_09=
이것은 필요 없습니다
출력할 곳에서는 <?echo $ex2_filed[2]?> <?echo $ex2_filed[3]?> 이렇게 해주면 됩니다
$ext2_00 =
~~
$ext2_09=
이것은 필요 없군요 지워도 동일하게 출력이 됩니다.
하지만
<?echo $ex2_filed[2]?> <?echo $ex2_filed[3]?> 이렇게 출력을 해도
게시물은
1 번게시물 010-000-0000
2 번게시물 010-000-0000
3 번게시물 010-000-0000
이렇게 나옵니다.. 물론 디비에는 1 2 3 번 각각 다르게
1 번게시물 010-111-1111
2 번게시물 010-222-2222
3 번게시물 010-333-3333
식으로 되어있구요..ㅠㅠ
제가해논 것도 답변주신 분들도 모두 적용 되는 방법이고..
문제는 포문이 시작되는 위치였습니다. 관심어린 답변 감사합니다..