Newbie need help:add 2nd PHP dropdown box


I am new to PHP, I have created a mysql/ php populated dropdown box on my webpage that connect to a table in my DB.

I would like to add another one that populates from a different table, but I am having issues getting it to populate.

this is my connection for the 1st one <?php
//links to db connection details
include_once ‘dbconnect.php’;

// creates a db conection
function connect () {
mysql_connect (host, user, pass) or die (‘Could not connect to DB’ . mysql_error());
mysql_select_db (db);
//closes db connection
function close() {
// run query to populate store drop down box on home page
function query() {
$mydata = mysql_query(“SELECT * FROM restaurants”);
while ($record = mysql_fetch_array ($mydata)) {
echo ‘<option value="’.$record[‘StoreNumber’].‘">’ . $record[‘StoreNumber’] . ‘</option>’;



home page has this

// link to stordrop.php to connect to db and load functions
include_once ‘storedrop.php’;


Please select your store number:
<select name “dropdown”>
<?php query() ?>
<?php close() ?>

2nd one needs to connect to same DB but look into table named contractors and pick and display Name?

is this possible?

thanks for your code