sql union all 질문입니다 ㅠ

sql union all 질문입니다 ㅠ

QA

sql union all 질문입니다 ㅠ

답변 2

본문

현재 lib/common.lib.php에서

 $sql = preg_replace("#^select.*from.*[\s\(]+union[\s\)]+.*#i ", "select 1", $sql);

 

주석을 해제하였고ㅜ

아래와 같이했는데 호출이안되네요 ㅠㅠ

혹시 조언주실수 있으신가요..ㅠ


<?
//데이터 베이스 연결하기
include_once('./_common.php');
$query = "select wr_subject from g5_write_111 UNION ALL select wr_subject from g5_write_222 ";
$result = sql_query($query);
?>
<table border="1" cellpadding="0" cellspacing="0">
   <tr>
      <td>제목</td>
   </tr>
<?
while($row = sql_fetch_array($result)) {
?>
   <tr>
      <td><?=$row['wr_subject']?></td>
   </tr>
<?
}
?>
</table>

이 질문에 댓글 쓰기 :

답변 2

작성하신 문장에는 문제가 없어보여집니다.

 

별도의 PhpMyAdmin에서 해당 쿼리만 한번 돌려보셨는지요?

select wr_subject from g5_write_111

UNION ALL

select wr_subject from g5_write_222

 

데이터가 정상적으로 나온다면..외부 환경에 영향을 받지 않을까 생각됩니다.

 

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 125,873
© SIRSOFT
현재 페이지 제일 처음으로