list에서 update 하기 > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

list에서 update 하기 정보

list에서 update 하기

본문

안녕하세요 고수님들~~

제가 리스트에서 보여주는 table 필드들입니다.



<td class="num" width="40" align="center"><font size="2"><?=$list[$i][num] + 105 ?></font></td>

<td class="name" width="100" align="center"><font size="2"><?=$list[$i][wr_datetime]?></font></td>

<td class="name" width="100" align="center"><font size="2"><?=$list[$i][wr_11]?></font></td>

<td class="name" width="100" align="center"><font size="2"><?=$list[$i][wr_10]?></font></td>

<td class="name" width="100" align="center"><font size="2"><?=$list[$i][wr_6]?></font></td>

<td class="name" width="100" align="center"><font size="2"><?=$list[$i][wr_2]?></font></td>
       
<td class="name" width="100" align="center"><font size="2"><?=$list[$i][wr_1]?></font></td>
   
<td class="name" width="100" align="center"><font size="2"><?=$list[$i][wr_5]?></font></td>
 
<td class="name" width="100" align="center"><font size="2"><?=$list[$i][wr_4]?></font></td>



저중에서 wr_11부분에 입력 버튼을 클릭하면 버튼을 클릭한 시간이 저장 되게 하고 싶습니다.



<input type="button" name="signature" value="입력" onclick="<? $now = $g4['time_ymdhis'];
    sql_query(" update $write_table set $list[$i][wr_11] = '$now'");  ?>



위의 식으로 입력 버튼을 만들었더니 리스트 중 하나만 wr_11에 클릭한 시각이 들어가는 것이 아니라

모든 리스트들의 wr_11필드에 시각이 들어갑니다. 입력버튼을 클릭한 리스트에만 시각이 들어가게

하고 싶습니다.

그리고 list페이지를 새로고침하면 시간이 새로고침한 시간으로 바뀌네여...입력했을 때의 시간이

그대로 있어야 하는 데요....

아 그리고 체크박스 권한을 관리자 외에도 쓸 수 있게 하려면 어떻게 해야 하나요...

어떻게 해야 할까요.....도와주세요^^

댓글 전체

sql_query(" update $write_table set $list[$i][wr_11] = '$now'");

mysql을 이해를 잘 못하신것같네요
위 쿼리는 $write_table로된 테이블에 $list[$i][wr_11] 로 된 변수 컬럼값에 $now를 넣어라 입니다
이는 * 이부분이 빠져있더라도 모든 $write_table의 $list[$i][wr_11]로 된 모든 컬럼에 값을 넣는게 됩니다.

이부분에다가 where 를 넣어주셔야 해당 게시물만 바뀌게 됩니다
where wr_id={$list[$i][wr_id]} 추가 하면 해당게시물만 들어가겠죠
전체 66,554 |RSS
그누4 질문답변 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT