Hello All! I have come here many times because I always get great support and my problems are generally fixed the same day. Unfortunately, I've forgotten my username. :p
I have 2 Pages of PHP. One where it you can specify what to search for, and what category's.
<form name="search" method="post" action="search.php">
Search for: <input type="text" name="find" /> in
<Select NAME="field">
<Option VALUE="phone">Phone</option>
<Option VALUE="last_name">Last Name</option>
<Option VALUE="address_1">Address</option>
<Option VALUE="email">E-mail</option>
</Select>
<input type="submit" name="search" value="Search" />
</form>
And here is the search page:
<?
mysql_connect("localhost", "user", "password") or die("Unable to connect to database.");
@mysql_select_db("database") or die("Unable to select database $DBName");
$field=$_POST['field'];
$find=$_POST['find'];
echo $field;
echo $find;
$data = mysql_query("SELECT * FROM contacts WHERE '$field' LIKE '%$find%'") or die(mysql_error());
while($result = mysql_fetch_array($data))
?>
I know that the search that I performed is getting passed to the next page, but the problem is, the PHP page just posted above either won't perform the search, or I have something set wrong? Any Help is greatly appreciated! Thanks!!