This is object oriented style:
$db = new mysqli('50.62.209.81:3306','user','password','MassWarVetsADM');
This is procedural style:
$result = mysql_query ($query);
i) don't mix these two styles
ii) don't use mysql_query, cause it's deprecated
iii) htmlspecialchars() is probably not the desired decoding.
For example you could make a query like the following:
$db = new mysqli('50.62.209.81:3306','user','password','MassWarVetsADM');
$query="SELECT Category FROM Category";
if ($result = $mysqli->query($query)){
echo "<select name="categoriesSelect" class="e1">";
echo "<option value="0">Please Select A Category</option>";
while($categoryinfo = $result->fetch_assoc()){
$sCategory = $categoryinfo['category'];
echo "<option value="\"".$sCategory" .="\">".$sCategory ."</option>";
}
echo "</select>";
}else{
echo "No items to select.";
}
The above example you could expand with try/catch and more...
You find more details about using the mysqli-extension on:
mysqli-class
mysqli-query
mysqli-result-class
mysqli-fetch_assoc