다시한번..member table 의 mb_1 에 입력 ..뭐가 잘못 됐을까요?? 정보
다시한번..member table 의 mb_1 에 입력 ..뭐가 잘못 됐을까요??본문
먼저 a 라는 버튼을 뷰페이지에 만들고.......................
a의 링크를 만들고..................
<?
// 클릭하면 mb_1에 1 추가
if ($is_admin) { echo "<div style='margin-top: 5px;'><a href=\"javascript:test('$board_skin_path/test.php?bo_table=$bo_table&wr_id=$wr_id');\"> 버튼a </a></div> "; }
?>
뷰스킨 하단에....스크립트..............추가..
function test(url) {
if (confirm("1 추가?")) {
win_open(url, 'hiddenframe');
}
}
그리고 test.php 내용...................
<?
include_once("./_common.php");
$sql = " update ".$member_table."
set mb_1 = '1'
where mb_id = '$view[mb_id]' ";
sql_query($sql);
?>
<script language=javascript>
alert("1추가.");
parent.window.location.reload();
</script>
이렇게 했는데....
test.php 가 먹통......
아무 반응이 없네요.....ㅜㅜ
어디가 잘못됐을까요??
a의 링크를 만들고..................
<?
// 클릭하면 mb_1에 1 추가
if ($is_admin) { echo "<div style='margin-top: 5px;'><a href=\"javascript:test('$board_skin_path/test.php?bo_table=$bo_table&wr_id=$wr_id');\"> 버튼a </a></div> "; }
?>
뷰스킨 하단에....스크립트..............추가..
function test(url) {
if (confirm("1 추가?")) {
win_open(url, 'hiddenframe');
}
}
그리고 test.php 내용...................
<?
include_once("./_common.php");
$sql = " update ".$member_table."
set mb_1 = '1'
where mb_id = '$view[mb_id]' ";
sql_query($sql);
?>
<script language=javascript>
alert("1추가.");
parent.window.location.reload();
</script>
이렇게 했는데....
test.php 가 먹통......
아무 반응이 없네요.....ㅜㅜ
어디가 잘못됐을까요??
댓글 전체
test.php에 $view[mb_id] 함수를 사용 못할듯 보이는데 ..
흠..... 그럼..다른 소스들은 아무런 문제가 없는건가요..
다른 걸로 수정해봐야겠습니다 ㅜㅜ;;;;
다른 걸로 수정해봐야겠습니다 ㅜㅜ;;;;
흠 어떻게 해야 되는지....ㅠㅠ
그리고
위의 소스를 한페이지에 집어 넣고 인크루드 하는 방법이 없을까요??
그리고
위의 소스를 한페이지에 집어 넣고 인크루드 하는 방법이 없을까요??
저렇게 하려면 $view[mb_id] 가 아닌 $write[mb_id] 를 사용합니다
where mb_id =' $write[mb_id]'
그리고
test('$board_skin_path/test.php?bo_table=$bo_table&wr_id=$wr_id');
<---여기서 소용없는 bo_table과 wr_id를 넘기는 것이 아니라 $view[mb_id]만 넘겨주는 것이
좋습니다(bo_table 과 wr_id를 넘기면 사용하지도 않을 해당 게시물 전체 내용을 디비에서 쿼리해 옵니다)
test('$board_skin_path/test.php?mb_id=$view[mb_id');
그리고 디비 쿼리문에서는 where mb_id = '$mb_id' ";
where mb_id =' $write[mb_id]'
그리고
test('$board_skin_path/test.php?bo_table=$bo_table&wr_id=$wr_id');
<---여기서 소용없는 bo_table과 wr_id를 넘기는 것이 아니라 $view[mb_id]만 넘겨주는 것이
좋습니다(bo_table 과 wr_id를 넘기면 사용하지도 않을 해당 게시물 전체 내용을 디비에서 쿼리해 옵니다)
test('$board_skin_path/test.php?mb_id=$view[mb_id');
그리고 디비 쿼리문에서는 where mb_id = '$mb_id' ";
답변 감사드립니다
가르쳐 주신대로.. 링크 수정하고
test.php 의 소스를
$sql = " update ".$member_table."
set mb_1 = '1'
where mb_id = '$write[mb_id]' ";
sql_query($sql);
위와 같이 수정했는데......................................
update set mb_1 = '1' where mb_id = 'admin'
1064 : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'set mb_1 = '1' where mb_id = 'admin'' at line 2
error file : /skin/board/basic_sc/test.php
------------위와 같은 오류가......ㅠㅠ -----------------
구문오류 같은데.. 무슨 뜻일까요?? ㅜㅜ
다른 테스트로 write table 의 여분필드 10으로 수정해 봤는데..
제대로 동작하는데..
멤버테이블에는 작동이 안되네요......ㅜㅜ
가르쳐 주신대로.. 링크 수정하고
test.php 의 소스를
$sql = " update ".$member_table."
set mb_1 = '1'
where mb_id = '$write[mb_id]' ";
sql_query($sql);
위와 같이 수정했는데......................................
update set mb_1 = '1' where mb_id = 'admin'
1064 : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'set mb_1 = '1' where mb_id = 'admin'' at line 2
error file : /skin/board/basic_sc/test.php
------------위와 같은 오류가......ㅠㅠ -----------------
구문오류 같은데.. 무슨 뜻일까요?? ㅜㅜ
다른 테스트로 write table 의 여분필드 10으로 수정해 봤는데..
제대로 동작하는데..
멤버테이블에는 작동이 안되네요......ㅜㅜ
아............ 해결했습니다
$sql = " update $g4[member_table]
이렇게 수정하니까 되네요...ㅎ
감사합니다 ^^
혹시모를 다른 분들을 위해서 ... test.php 의 내용...
<?
$g4_path = "../../..";
include_once("$g4_path/common.php");
$sql = " update $g4[member_table]
set mb_1 = '1'
where mb_id = '$write[mb_id]' ";
sql_query($sql);
?>
<script type="text/javascript">
alert("1 입력.");
window.open('about:blank','_self').close();
</script>
$sql = " update $g4[member_table]
이렇게 수정하니까 되네요...ㅎ
감사합니다 ^^
혹시모를 다른 분들을 위해서 ... test.php 의 내용...
<?
$g4_path = "../../..";
include_once("$g4_path/common.php");
$sql = " update $g4[member_table]
set mb_1 = '1'
where mb_id = '$write[mb_id]' ";
sql_query($sql);
?>
<script type="text/javascript">
alert("1 입력.");
window.open('about:blank','_self').close();
</script>