내 웹 사이트의 회원 페이지에서 회원이 다른 회원의 정보를 조회 할 수 있도록 옵션이 필요합니다. 지금까지 내가 무슨 짓을하는 것은MySQL 데이터베이스에 검색 양식 연결 및 결과 표시
<form id="searchform" name="searchform" action="searchresults.php" method="post">
Search Membership
<input type="text" name="search" id="textfield" placeholder="Search Members" />
<input type="submit" name="button" id="button" value="Search" />
</form>
내가 또한 회원 정보의 모든 내 데이터베이스에서 테이블을 만들었습니다 ... 검색 양식을 만들 수 있습니다. 이제는 데이터베이스 테이블과 통신하고 검색 양식에 입력 된 내용을 가져 와서 내 결과 페이지에 결과를 표시하는 양식을 얻는 데 도움이 필요합니다.
나는 이것에 익숙하지 않고 어떤 도움을 주시면 감사하겠습니다. 감사.
UPDATE : 그래서 지금은 내 searchresults.php 페이지에서 다음 PHP 코드를 ...이
<?php
error_reporting(-1);
$host="";
$username="";
$password="";
$db_name="";
$tbl_name="MOAMemberSearch";
mysql_connect($host, $username, $password) or die("cannot connect");
mysql_select_db($db_name) or die("cannot select DB");
$sql = "SELECT * FROM MOAMemberSearch";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
if (false === $result) {
echo mysql_error();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Member Search - MOA</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<link href="css/jquery.ennui.contentslider.css" rel="stylesheet" type="text/css" media="screen,projection" />
<style type="text/css">
#content_wrapper #content table {
color: #000;
}
</style>
</head>
<body>
<div id="menu_wrapper">
<div id="menu">
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="boardofdirectors.html">Board</a></li>
<li><a href="members.php" class="current">Members</a></li>
<li><a href="ratingcard.html">Rating Card</a></li>
<li><a href="join.html">Join MOA</a></li>
<li><a href="contact.html">Contact Us</a></li>
</ul>
</div> <!-- end of menu -->
</div> <!-- end of menu wrapper -->
<div id="header_wrapper">
<div id="header"><!-- end of slider -->
</div>
<!-- header -->
</div>
<!-- end header wrapper -->
<div id="content_wrapper">
<div id="content">
<h1>Search Results</h1>
<table width="930" border="0" style="font-size:12px">
<tr>
<th>Sports</th>
<th>Last Name</th>
<th>First Name</th>
<th>Address</th>
<th>City</th>
<th>State</th>
<th>Zip</th>
<th>Phone 1</th>
<th>Phone 2</th>
<th>Email</th>
</tr>
<tr>
<td><?php echo $rows['Sports']; ?></td>
<td><?php echo $rows['LastName']; ?></td>
<td><?php echo $rows['FirstName']; ?></td>
<td><?php echo $rows['Address']; ?></td>
<td><?php echo $rows['City']; ?></td>
<td><?php echo $rows['State']; ?></td>
<td><?php echo $rows['Zip']; ?></td>
<td><?php echo $rows['Phone1']; ?></td>
<td><?php echo $rows['Phone2']; ?></td>
<td><?php echo $rows['Email']; ?></td>
</tr>
</table>
현재 검색 결과가
예. 이 오류는 매우 일반적이며 다음 기본 단계에 따라 문제를 해결하기 쉽습니다. 검색어가 실패했습니다. 이유를 알아 내야합니다. 적어도 하나의 대답이 그것을 설명하고 어떻게하는지 설명합니다. –
제공하신 "새로운"답변 페이지의 코드를 이미 구현했습니다. 같은 오류가 나타납니다. 분명히 문제를 해결하지 못합니다. 설명해 주시겠습니까? – Patrick
이 문제를 해결하려면 [이 대답] (http://stackoverflow.com/a/11674313/250259)의 단계를 따르십시오. 처음에는 MySQL이보고하는 오류를 확인하지 않았습니다. 그것은 항상 1 단계입니다. –