i m using a simple form with one search field
anyone is there to solve this issue
connect.php
1 2 3 4 5 6 7 8 |
<?php $linkfirst = mysql_connect('localhost', 'root', ''); if (!$linkfirst) { die('Could not connect: ' . mysql_error()); } mysql_select_db('hello', $linkfirst) or die('Could not select database.'); ?> |
test.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
<?php include"connect.php"; $search_employee = mysql_real_escape_string(trim($_POST['name'])); $search_employee='vas'; $find_name = mysql_query("SELECT Name FROM employee WHERE Name LIKE'%$search_employee%'",$linkfirst); while($row = $find_name->fetch_object()){ { $EmployeeName = $row['Name']; echo "$EmployeeName<br />"; } } ?> <html> <head> <title>Searching an Employee</title> </head> <body> <form name="search" method="post" action="test.php"> Search for: <input type="text" name="name" /> <input type="submit" name="submit" value="submit"/> </form> </body> </html> |