请帮帮我..我不知道为什么我的PHP代码中没有输出。下面是我的index.php代码
<html>
<body>
<form action="search.php" method="POST">
<input type="text" name"number" placeholder="Search...."><br/>
<input type = "submit" value="Search">
</form>
</body>
</html>
这是我的search.php。
<html>
<body>
<?php
mysql_connect("localhost","root","");
mysql_select_db("login");
$initial = mysql_real_escape_string($_POST['initial']);
$find_videos = mysql_query("SELECT * FROM `sigup` WHERE `initial` LIKE '%initial%'");
while($row = mysql_fetch_assoc($find_videos))
{
$name = $row['name'];
echo "$name<br/ >";
}
?>
</body>
</html>
答案 0 :(得分:0)
mysql_query("SELECT * FROM `sigup` WHERE `initial` LIKE '%$initial%'");
<input type="text" name="initial" placeholder="Search....">
答案 1 :(得分:0)
<html>
<body>
<form action="search.php" method="POST">
<input type="text" name="initial" placeholder="Search...."><br/>
<input type = "submit" value="Search">
</form>
</body>
</html>
<强>的search.php 强>
<html>
<body>
<?php
mysql_connect("localhost","root","");
mysql_select_db("login");
$initial = mysql_real_escape_string($_POST['initial']);
$find_videos = mysql_query("SELECT * FROM `sigup` WHERE `initial` LIKE '%$initial%'");
while($row = mysql_fetch_assoc($find_videos))
{
$name = $row['name'];
echo "$name<br/ >";
}
?>
</body>
</html>
答案 2 :(得分:0)
<html>
<body>
<form action="search.php" method="POST">
<input type="text" name="number" placeholder="Search...."><br/>
<input type = "submit" value="Search">
</form>
</body>
</html>
的search.php
<html>
<body>
<?php
mysql_connect("localhost","root","");
mysql_select_db("login");
$initial = mysql_real_escape_string($_POST['number']);
$find_videos = mysql_query("SELECT * FROM sigup WHERE initial LIKE '%initial%'");
while($row = mysql_fetch_assoc($find_videos))
{
$name = $row['name'];
echo "$name";
}
?>
</body>
</html>