clo8 wrote:I think I'm just confusing myself more and more!! I basically need a loop that takes a value entered via a search form and compares it to fields in the database, then if it matches displays that field and if it doesn't displays a message saying there are no matching fields.
xcx
Yes I think you are as the code you have posted here doesn't do that!
Your code will need to change to something like this
$search_term = mysql_real_escape_string(trim($_POST['search_term']));
$result = mysql_query("SELECT * FROM availability WHERE field_name = $search_term");
this will search a a search term against a particular mysql field, to search more than one field and more than one term just add more "where" criteria.
You will also need to check that the array you are pulling data from is actually populated the way you think it is so after the line
$row = mysql_fetch_array($result);
use this to see the array contents, specifically the array keys
echo "<pre>";
print_r($row);
echo "</pre>";
You'll then be able to check that the $row names are correct;