I am trying to search my MySQL database based on a globalvariable but this is not functioning. Here is my code below. Ants hints will be appreciated.
if (!isset($Whatis)) {
echo "Value for Whatis is not set";
} else {
echo $Whatis ;
}
function PullOver($Monthselect) {
$dateY = date("Y");
$Valforthis = "select global $Whatis from graph where month = '$Monthselect' and year = '$dateY'";
echo $Valforthis ;
$retrieve = mysql_query($Valforthis);
$Val = mysql_fetch_array($retrieve);
echo $Val['$Whatis'] ;
}
PullOver('January');