<html>
<body>

<form name = profiles method = post action = "./new2.php">

성별을 입력해 주세요<br>
성별: <input type=text name=a><br>
<input type=submit value=입력><br>
<input type=reset value=취소><br>
</form>
</body>
</html>

이거 실행시켜서 남  입력 하면


<?PHP

$conn = mysql_connect ('localhost', 'root', 'apmsetup');
$db_status = mysql_select_db ('profiles');
if (!$db_status){
error  ("DB_ERROR");
exit;
}

$query="select * from profiles where gender = '$a'";

mysql_query("SET NAMES 'euckr'"); // 주의 : 한글
$result = mysql_query ($query);

print "<table border = 1><tr>".
"<th>name</th>".
"<th>gender</th>".
"<th>byear</th>".
"<th>height</th>".
"<th>hobby</th></tr>";

while($row = mysql_fetch_row ($result)){
print "<tr><td>".$row[0]."</td>".
"<td>" . $row[1] . "</td>".
"<td>" . $row[2] . "</td>".
"<td>" . $row[3] . "</td>".
"<td>" . $row[4] . "</td></tr>";
}
print "</table>";
?>

이게 실행되어서 gender 필드가 남 인 값들만 출력하려고 하는데요


html파일에서 남 입력, 전송하면 
php파일에서는 그냥 





이렇게만 뜹니다 ㅠㅠ 도와주십시오행님들..