L

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

· 2009-09-20 (일) 20:55:42 · 1366 · 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년차니까 초보는 아님 ㅋ

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

자유게시판

203,135건
+
제목 글쓴이 날짜 조회
09-09-21 조회 1,974
09-09-21 조회 2,193
09-09-21 조회 1,863
09-09-21 조회 1,560
09-09-21 조회 3,116
09-09-20 조회 5,310
09-09-20 조회 1,825
09-09-20 조회 1,367
09-09-20 조회 1,863
09-09-20 조회 1,936
09-09-20 조회 1,788
09-09-20 조회 1,772
09-09-20 조회 1,377
09-09-20 조회 1,374
09-09-20 조회 1,368
09-09-20 조회 1,524
09-09-20 조회 2,076
09-09-20 조회 1,307
09-09-20 조회 1,659
09-09-20 조회 2,886