Think of the form as the input. Until you submit it, there is nothing to process. So you will need a processing page, or if you are re-displaying the search form, the form will submit to the same page - which means you need to test whether the page was submitted or not. You can do this through the use of the $_POST array (assuming you are using the recommended POST method for your form).
For example:
if(isset($_POST))
// Form was submitted. Now process the form...
The other thing you might want to do is keep your MySQL connection code in an "include" file, rather than littering every page with it.
For example, create a file called "db_connect.php" and put it in your root/includes folder. Copy your connect stuff to it (Note: leave off the php tags, and you don't need a return value for mysql_select_db):
Contents of db_connect.php:
$username = "root";
$password = "";
$hostname = "localhost";
$dbh = mysql_connect($hostname, $username, $password)
or die("Unable to connect to MySQL");
mysql_select_db("jobjar",$dbh)
or die("Could not select jobjar");
Now, you will add just one line to your processing form:
if(isset($_POST))
{
// The following assumes you are in your root web folder
// (note the relative addressing, just like in HTML):
include('includes/db_connect.php');
// ...
}
In order to access your database, you use the link established by mysql_connect():
if(isset($_POST))
{
include('../includes/db_connect.php');
$query = "SELECT * FROM SomeTable";
$result = mysql_query($query, $dbh);
// You now have a recordset! Get the first row from the recordset...
$row = mysql_fetch_assoc($result);
// You now have one row of data! Get a field from the row...
$value = $row['field1'];
// etc...
}