-3

Please help me.. I don't know why there is no output in my PHP code.. Below is my index.php code

<html>
<body>

<form action="search.php" method="POST">
<input type="text" name"number" placeholder="Search...."><br/>
<input type = "submit" value="Search">

</form>

</body>
</html>

and this is my 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>
zzlalani
  • 22,960
  • 16
  • 44
  • 73

3 Answers3

0
 mysql_query("SELECT * FROM `sigup` WHERE `initial` LIKE '%$initial%'");

 <input type="text" name="initial" placeholder="Search....">
Maresh
  • 4,644
  • 25
  • 30
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>
Guru
  • 621
  • 1
  • 4
  • 12
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>
getty
  • 135
  • 11