Hi,
Absolute beginner in php here. I am created a dropdown menu in my php code. Now I want to use the value selected by the user from the menu in the sql query that follows. How do I do that?
[php]<?php
function renderCrossConnectInventory ()
{
$patchpanels = array(
‘SM Fiber Patch - 110330)’ => 1,
‘SM Fiber Patch - 105831)’ => 2,
);
function generateSelect($name = ‘’, $options = array()) {
$html = ‘’;
foreach ($options as $option => $value) {
$html .= ‘’.$option.’’;
}
$html .= ‘’;
return $html;
}
print “
”;
$html = generateSelect(‘patchpanel’, $patchpanels);
echo “   Select PatchPanel:”,$html;
print"
";
$query = “select a.name, b.string_value from Rack a LEFT JOIN RackSpace b ON a.id=b.rack where a.id=‘29’ and b.attr_id=‘10016’” ;
}
?>[/php]
thanks,
Shar.