\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("\n"); // second line print("\n"); // third line print("\n"); } print("
 
"); print("$data->category
"); if($data->name && $data->contact) { print("$data->name ($data->contact)"); } else { print($data->name . $data->contact); } print(""); print($data->phtyp1 . "   " . $data->phnum1); print("
"); print($data->address); print(""); print($data->phtyp2 . "   " . $data->phnum2); print("
"); print("$data->city, $data->state. $data->zip"); if($data->zipext) print("-" . $data->zipext); print(""); print($data->phtyp3 . "   " . $data->phnum3); print("
\n"); // append a "New Search" button if($content == "mem_result") { print("
\n"); print("\n"); print("\n
\n"); } // release the database query result free_result($result); } else { print("
\n"); print("Sorry, your query returned an empty result.
\n"); print("
\n
\n\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"); } ?>