L

제가보면 에러가 안보여요 ㅠ

· 2009-09-20 (일) 20:55:42 · 1360 · 3
잘못된 코딩/탈고/삐침등은 역시 제3자의 눈이 젤 정확한거같습니다.

<?
$sitemap_bo = array('test_drive','review','parts_review','project','news');
for($i=0;$i<count($sitemap_bo);$i++){
$site_qry = sql_query("select bo_table, bo_subject, bo_category_list from g4_board where bo_table = $sitemap_bo[$i] limit 1");
$site_row = sql_fetch_array($site_qry);
$cate = explode('|',$site_row[0][bo_category_list]);
 ?>

select bo_table, bo_subject, bo_category_list from g4_board where bo_table = test_drive limit 1

1054 : Unknown column 'test_drive' in 'where clause'

뭘까요 ㅠ 보드명,컬럼 구문등 제눈엔 다 맞는거같은데 오디가 틀렸대요? ㅠㅠ

|

댓글 3개

2009-09-20 (일) 21:12:43
$site_qry = sql_query("select * from g4_board where bo_table = $sitemap_bo[$i] limit 1");

요렇게 바꿔줘보세요...
초보는 괜히 셀렉해줄필요 없습니다...
2009-09-20 (일) 21:25:31
$site_qry = sql_query("select bo_table, bo_subject, bo_category_list from g4_board where bo_table = $sitemap_bo[$i] limit 1");
여기서
$sitemap_bo[$i] --> '' 로 감싸줘야 할것 같습니다.
아 작은따옴표; 배열 전에 잘 안먹어서 '".$."'로 줬다 안되서 저건 생각도 안했는데 ㅋㅋ 감사합니다.

셀렉은 쿼리가 한페이지에 한 3,40개이상 걸려있어서 속도를 위해 해줬습니다.

일단 2년차니까 초보는 아님 ㅋ

아직 최적화전이긴하지만 기본최적화는 해줘야죠
댓글을 작성하시려면 로그인이 필요합니다.

자유게시판

202,902건
+
제목 글쓴이 날짜 조회
09-09-21 조회 1,363
09-09-21 조회 2,763
09-09-21 조회 1,881
09-09-21 조회 1,626
09-09-21 조회 1,639
09-09-21 조회 1,362
09-09-21 조회 1,979
09-09-21 조회 1,971
09-09-21 조회 2,191
09-09-21 조회 1,860
09-09-21 조회 1,555
09-09-21 조회 3,110
09-09-20 조회 5,303
09-09-20 조회 1,818
09-09-20 조회 1,361
09-09-20 조회 1,861
09-09-20 조회 1,931
09-09-20 조회 1,785
09-09-20 조회 1,768
09-09-20 조회 1,373