Hi,
I am tryng to populate a SELECT from PHP and Jquery but the output from PHP is adding a backslash to the closing </option> tag and removing the <option> opening tag like this:
Bank Facilities<\/option>
Embassy<\/option>
Government<\/option>
here is my code:
$request_category = $_GET['cboRequest'];
$mysql_query = $mysql_connection->prepare('CALL sp_get_request_processing_period(:param_request_category)');
$mysql_query->bindParam(':param_request_category', $request_category, PDO::PARAM_STR);
$mysql_query->execute();
while($mysql_row = $mysql_query->fetch())
{
$request_name = $mysql_row["request_category_name"];
$processing_days = $mysql_row["processing_period_in_days"];
}
$request_purpose = "";
$mysql_query = $mysql_connection->prepare("CALL sp_populate_request_purpose(:param_request_category)");
$mysql_query->bindParam(':param_request_category', $request_category, PDO::PARAM_STR);
$mysql_query->execute();
while($mysql_row = $mysql_query->fetch())
{
$request_purpose .= "<option value=" . $mysql_row["request_purpose_id"] . ">" . $mysql_row["request_purpose_title"] . "</option>";
}
$response = array("name" => $request_name, "days" => $processing_days, "purpose" => $request_purpose);
echo json_encode($response);