<?php
$data=$_GET['foo'];
if($data=="option1")
{
    echo "selected value is option1";    // add sql operation here if option 1
}
else if($data=="option2")
{
    echo "selected value is option2";  // add sql operation here if option2
}
?>