【发布时间】:2011-11-23 01:31:54
【问题描述】:
我已经构建了这个在我的数据库中搜索一个表的小脚本,但是对于我的生活,如果有人只搜索电子邮件,我似乎无法找到任何关于如何显示表信息的地方。我希望能够仅搜索电子邮件并让它显示数据库中该电子邮件地址的所有信息。有什么想法吗?
<?php
$profile = $_POST["profile"];
mysql_connect ("", "", "");
mysql_select_db ("");
$query = "SELECT * FROM `profile` WHERE `email`='$email' and `about`='$about' and
`age`='$age' and `sex`='$sex' and `website`='$website'";
$result = mysql_query ($query);
if ($result) {
while($row=mysql_fetch_row($result))
{
echo $row[0],$row[1],$row[2];
}
}else{
}
?>
<form action="profile.php" method="post">
<input type="text" name="search"><br>
<input type="submit">
【问题讨论】: