안녕하세요 sql 공부중인 사람인데 궁금한점이 생겨서 문의드립니다.

매출이 오르면 내리는 수수료! 지금 수수료센터에서 전자결제(PG)수수료 비교견적 신청해 보세요!
안녕하세요 sql 공부중인 사람인데 궁금한점이 생겨서 문의드립니다.

QA

안녕하세요 sql 공부중인 사람인데 궁금한점이 생겨서 문의드립니다.

본문

<?php
ob_start();
include_once($_SERVER['DOCUMENT_ROOT'] ."/common.php");
$is_title="";


$sql="select * from g5_member";
$result=sql_query($sql);
?>
<!doctype html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<style type="text/css">
</style>
<title>회원내역</title>
</head>
<body>
<table>
<tr>
<th scope="col">회원아이디</th>
<th scope="col">이름</th>
<th scope="col">연락처</th>
<th scope="col">포인트</th>
<th scope="col">출신학교</th>
<th scope="col">포인트총합계</th>
</tr>
 <?php
        for ($i=0; $list = sql_fetch_array($result); $i++) {
         ?>
<tr>
<td class='txt'><?php echo $list['mb_id']?></td>
<td class='txt'><?php echo $list['mb_name']?></td>
<td class='txt'><?php echo $list['mb_hp']?></td>
<td class='txt'><?php echo $list['mb_point']?></td>
<td class='txt'><?php echo $list['mb_1']?></td>
</tr>
<?php }?>
</table>
</body>
</html>

 

이런식으로 짰는데,

여기서 mb_1 값에 서울대학교, 연세대학교가있을때

검색기능을 넣어서 서울대학교만 검색을 하려고 합니다.

어떻게 해야할까요?

이 질문에 댓글 쓰기 :

답변 3

$sql="select * from g5_member where mb_1 ='서울대학교' ";

 

$sql="select * from g5_member where mb_1 like '%서울%' ";

 

 

 

답변을 작성하시기 전에 로그인 해주세요.
전체 21
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT