Jump to content

Onedgill

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by Onedgill

  1. Thanks, 'Old Man From Scene' . I added the "%" wildcard character and it worked like magic!
  2. I forgot to say, please help. Thanks
  3. I created an Intranet and I have a telephone directory where you can search for an employee's contact info. When I do a seach to display all the data in the table, it works but when I search by a specific name the php code returns no data from the table. Not sure why: This is the form code on the html page where the user types the data to search for: <form action= "directory02.php" method="post">NAME: <input type="text" name="find"/><input type="submit" value="Search"/></form> This is the php code on the directory02.php page: <?php$con = mysql_connect("localhost","intranet","sysmgr");if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("distrdirectory", $con);$find=$_POST['find'];$result = mysql_query("SELECT * FROM listingWHERE Name LIKE '$find'"); echo "<table width='800' cellpadding='0' cellspacing='0'><tr height= '20' bgcolor='#CCCCCC'><th align ='left'>Extension</th><th align ='left'>Name</th><th align ='left'>Position</th><th align ='left'>Department</th></tr>"; while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['Extension'] . "</td>"; echo "<td>" . $row['Name'] . "</td>"; echo "<td>" . $row['Position'] . "</td>"; echo "<td>" . $row['Department'] . "</td>"; echo "</tr>"; }echo "</table>"; mysql_close($con);?> directory.htmldirectory02.php Style.css
×
×
  • Create New...