\n");
// create the table for the results
print("\n");
for($row=0; $row < $count; $row++) {
$data = fetch_object($result, $row);
// create a category header
if($data->category != $samecategory) {
if($samecategory)
print("  |
\n");
print("\n");
$rowshade = 0;
$samecategory = $data->category;
}
// alternate bgcolors
$shade = (($rowshade++ & 1) ? "dark" : "light");
// first line
print("");
if($data->name && $data->contact) {
print("$data->name ($data->contact)");
} else { print($data->name . $data->contact); }
print(" | ");
print($data->phtyp1 . "   " . $data->phnum1);
print(" |
\n");
// second line
print("");
print($data->address);
print(" | ");
print($data->phtyp2 . "   " . $data->phnum2);
print(" |
\n");
// third line
print("");
print("$data->city, $data->state. $data->zip");
if($data->zipext) print("-" . $data->zipext);
print(" | ");
print($data->phtyp3 . "   " . $data->phnum3);
print(" |
\n");
}
print("
\n");
// append a "New Search" button
if($content == "mem_result") {
print("\n");
}
// release the database query result
free_result($result);
} else {
print("\n");
print("Sorry, your query returned an empty result.
\n");
print("
\n\n");
}
// close the database connection
// close($connection);
} else {
print("Database Error
\n");
print("Failed to connect to database: ");
print($dbname . "
\n\n");
}
?>