Q.I then want the selected item from my first drop down box, and placed it into
my $lineIDSelection variable so that I can insert it into a query for the next
drop down box
See you can achieve this by Ajax:-
On-change on first drop-down you get value and on the basis of first drop-down value you can generate second drop-down.
PHP:- assign id to drop-down
echo "<select name='line' id='dropDown1'>";
Jquery :-
$('#dropDown1').change(function() {
var sel_item=$(this).val();
// sel_item is first dropdown selected value.
// pass it to ajax request
// in you ajax request get sel_item and assign it to $lineIDSelection
});