php로 mysql접속문제관련하여 질문드려요
본문
도대채 뭐가틀린건지모르겠습니다.
http://prm7500.dothome.co.kr/logintest.php 접속시 false라는 메세지만나오는데 어떻게해야되나요
초보라서 무엇이문제인지 알려주시면 감사하겠습니다.
(아참 이것은 안드로이드와 로그인여동을하기위한 php설정을 한 것입니다.)
<?php
$host='localhost';//insert as yours
$uname='prm7500';
$pwd='비밀입니다';
$db="prm7500";
$con = mysql_connect($host,$uname,$pwd) or die("connection failed");
mysql_select_db($db,$con) or die("db selection failed");
$id=$_GET['mb_id'];
$r=mysql_query("select mb_password,mb_name from g5_member where mb_id='$mb_id'",$con);
$row=mysql_fetch_array($r);
print(json_encode($row));
mysql_close($con);
?>
답변 1
$id=$_GET['mb_id'];
$r=mysql_query("select mb_password,mb_name from g5_member where mb_id='$mb_id'",$con);
이 두부분이 안맞아서 그러는것 아니신가요?
$mb_id=$_GET['mb_id'];
로 처리하셔야 하는것은 아닌지....