I want to run different query as per ID received from table, Please help to resolve;
For example if $idcat == 5 Run query A and else if $idcat == 4 run query B
//include connection file
include_once("connection.php");
$db = new dbObj();
$connString = $db->getConnstring();
$params = $_REQUEST;
$action = isset($params['action']) != '' ? $params['action'] : '';
$empCls = new FillEmpty($connString);
function insertFillEmpty($params) {
$data = array();
$catintid = "SELECT categoryinternalID FROM inhandemptystock";
$results = mysqli_query($this->conn, $catintid);
$raw = mysql_fetch_array($results);
$idcat = $raw["categoryinternalID"];
if ($idcat == "5") {
$sqll = "INSERT INTO `testing` (goog) VALUES('" . $params["enteredBy"] . "'); ";
echo $result = mysqli_query($this->conn, $sqll) or die("error to insert employee data");
} else {
echo '<script language="javascript">';
echo 'alert("Something is wrong")';
echo '</script>';
}
}