쿼리 질문좀 드릴께요~~~~ 채택완료
은빛여전사
8년 전
조회 1,789
아래 소스를 testquery.php 로 저장하여 루트폴더에 올렸습니다
주소입력창에 localhost/testquery.php?ID=admin 입력하면
회원 포인트가 화면에 나와줘야 하는 소스입니다
무엇이 잘못 되었는지 오류가 나서요...
도와주세요..ㅠㅠㅠ
<?php
$con=mysqli_connect("localhost","sun7684","qwer1234","sun7684");
if (mysqli_connect_errno($con))
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$ID = $_GET['ID'];
$result = mysqli_query($con,"SELECT mb_point FROM g5_member where ID='$ID'");
$row = mysqli_fetch_array($result);
$data = $row[0];
if($data){
echo $data;
}
mysqli_close($con);
?>
댓글을 작성하려면 로그인이 필요합니다.
답변 1개
채택된 답변
+20 포인트
8년 전
다른건 만드시기 나름이겠지만<br />
<br />
그누보드를 사용하신다면<br />
<div class="code-block-wrapper">
<button onclick="copyCodePrism(this)" class="copy-code-btn" style="position: absolute; top: 10px; right: 10px; z-index: 10; background: rgba(0,0,0,0.5); color: #fff; border: 1px solid rgba(255,255,255,0.3); padding: 6px 12px; border-radius: 4px; font-size: 12px; cursor: pointer; transition: all 0.2s; backdrop-filter: blur(10px);" onmouseover="this.style.background='rgba(0,0,0,0.7)'; this.style.transform='translateY(-1px)'" onmouseout="this.style.background='rgba(0,0,0,0.5)'; this.style.transform='translateY(0)'">
<svg style="width: 14px; height: 14px; display: inline-block; vertical-align: middle; margin-right: 4px;" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"></path>
</svg>
<span class="copy-text">Copy</span>
</button>
<pre class="language-sql"><code class="language-sql">SELECT mb_point FROM g5_member where ID='$ID'
//이부분에서
SELECT mb_point FROM g5_member where mb_id='$ID'</code></pre>
</div><br />
로 하셔야 합니다
<br />
그누보드를 사용하신다면<br />
<div class="code-block-wrapper">
<button onclick="copyCodePrism(this)" class="copy-code-btn" style="position: absolute; top: 10px; right: 10px; z-index: 10; background: rgba(0,0,0,0.5); color: #fff; border: 1px solid rgba(255,255,255,0.3); padding: 6px 12px; border-radius: 4px; font-size: 12px; cursor: pointer; transition: all 0.2s; backdrop-filter: blur(10px);" onmouseover="this.style.background='rgba(0,0,0,0.7)'; this.style.transform='translateY(-1px)'" onmouseout="this.style.background='rgba(0,0,0,0.5)'; this.style.transform='translateY(0)'">
<svg style="width: 14px; height: 14px; display: inline-block; vertical-align: middle; margin-right: 4px;" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"></path>
</svg>
<span class="copy-text">Copy</span>
</button>
<pre class="language-sql"><code class="language-sql">SELECT mb_point FROM g5_member where ID='$ID'
//이부분에서
SELECT mb_point FROM g5_member where mb_id='$ID'</code></pre>
</div><br />
로 하셔야 합니다
로그인 후 평가할 수 있습니다
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인