[insert_php]
if(isset($_POST[‘searchTerm’])){
$searchTerm=trim($_POST[‘searchTerm’]);
if(preg_match(“/^[ a-zA-Z]+/”, $searchTerm ) && strlen($searchTerm) >= 3){
$searchArray = preg_split(‘/[\s*,\s*]*,+[\s*,\s*]*/’, $searchTerm);
//connect to the database
$db=mysqli_connect(“127.0.0.1”, “uscm”, “QfqKmrOv2OmqgKUzKSV3”, “wp_uscm”) or die (‘I cannot connect to the database because: ‘ . mysql_error());
//-query the database table
$sql=”SELECT * FROM mv_cdbg WHERE City = ‘” . $searchArray[0] . “‘ AND State = ‘” . $searchArray[1] . “‘”;
//-run the query against the mysql query function
$result=mysqli_query($db, $sql);
//-create while loop and loop through result set
while($row=mysqli_fetch_array($result)){
$City=$row[‘City’];
$State=$row[‘State’];
$CDBG=$row[‘CDBG’];
//-display the result of the array
echo “

    \n”;
    echo “

    President Trump’s proposed budget would eliminate

    $” . number_format($CDBG) . “

    from ” . $City . “, ” . $State . “‘s budget.

    \n”;
    echo “

“;
}
}
else{
echo “

Search term must contain at least 3 characters.

“;
}
}
[/insert_php]