쿼리문 좀 봐주세요.. 정보
쿼리문 좀 봐주세요..본문
$w_num=sql_fetch("select count(*) as cnt from $writing_table where mb_id='$member[mb_id]'");
$writing_num=number_format($w_num[cnt]);
테이블명 writing라는 게시판에 있는 내가 쓴 글의 갯수를 뽑아내는건데요..
안되네요..
뭐가 잘못되엇나요?
초보올림...
$writing_num=number_format($w_num[cnt]);
테이블명 writing라는 게시판에 있는 내가 쓴 글의 갯수를 뽑아내는건데요..
안되네요..
뭐가 잘못되엇나요?
초보올림...
댓글 전체
쿼리문에 별다른 이상이 있는것 같지는 않습니다.
$w_num=sql_fetch("select count(*) as cnt from $writing_table where mb_id='$member[mb_id]'");
를
$sql = "select count(*) as cnt from $writing_table where mb_id='$member[mb_id]'";
echo $sql;
$w_num=sql_fetch($sql);
과 같이 수정하신후 구문에 이상이 있는지 $sql 을 출력해 보세요.
$w_num=sql_fetch("select count(*) as cnt from $writing_table where mb_id='$member[mb_id]'");
를
$sql = "select count(*) as cnt from $writing_table where mb_id='$member[mb_id]'";
echo $sql;
$w_num=sql_fetch($sql);
과 같이 수정하신후 구문에 이상이 있는지 $sql 을 출력해 보세요.
$w_num=sql_fetch("select count(*) as cnt from $writing_table where mb_id='$member[mb_id]'");
$writing_num=number_format($w_num[cnt]);
<p align="right"><?=$writing_num?></p>
출력해보니까.. 에러가 생겨요..ㅠㅠㅠ
----------------------------------------------------------------------------------
select count(*) as cnt from where mb_id='photo2024'
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 'where mb_id='photo2024'' at line 1
error file : /bbs/board_writing.php
$writing_num=number_format($w_num[cnt]);
<p align="right"><?=$writing_num?></p>
출력해보니까.. 에러가 생겨요..ㅠㅠㅠ
----------------------------------------------------------------------------------
select count(*) as cnt from where mb_id='photo2024'
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 'where mb_id='photo2024'' at line 1
error file : /bbs/board_writing.php
$writing_table 을 확인해보세요.
from절에 테이블 명이 빠진채 출력이 되네요.
from절에 테이블 명이 빠진채 출력이 되네요.
테이블명은 어떻게 넣어줘야되나요?
게시판 테이블 명이 writing이거든요.
게시판 테이블 명이 writing이거든요.
$write_table = $g4[write_prefix].$bo_table;
훔.. 근데 $write_table이 설정이 안되면 $bo_table이 제대로 값이 있을지도 의문이긴 하네요.
일단 저 문장을 위쪽에 넣어주시고 위에처럼 sql문을 출력해보고 g4_write_ 까지만 나온다면 아예
$write_table = "g4_write_writing";
이렇게 해주시는것도..
훔.. 근데 $write_table이 설정이 안되면 $bo_table이 제대로 값이 있을지도 의문이긴 하네요.
일단 저 문장을 위쪽에 넣어주시고 위에처럼 sql문을 출력해보고 g4_write_ 까지만 나온다면 아예
$write_table = "g4_write_writing";
이렇게 해주시는것도..
아이쿵..감사드립니다..