I am getting this warning even though everything functions perfectly.
Here is the code snippet:
$selected_Id = isset($_GET["url"])?$_GET["url"]:"";
// if no services selected, go to first service
$mysqliContent = new CustomMySqli();
if ($selected_Id=="") {
$queryContent = "SELECT servicesID, ServiceUrl, title, content FROM services order by orderField asc LIMIT 1";
$stmtContent = $mysqliContent->prepare($queryContent);
} else {
$queryContent = "SELECT servicesID, ServiceUrl, title, content FROM services WHERE ServiceUrl = '$url'";
$stmtContent = $mysqliContent->prepare($queryContent);
$stmtContent->bind_param('d',$selected_Id);
}
/* execute query */
$resultContent = $stmtContent->execute();
// bind results
$stmtContent->bind_result($idContent, $urlContent, $titleContent, $contentContent);
$contentContent = stripslashes($contentContent);
/* fetch values */
$stmtContent->fetch();
$selected_Id = $idContent;
/* close statement */
$stmtContent->close();
?>
Any help would be greatly appreciated.
It should be:
Prepared statements replace all question marks with the variable(s) supplied to bind_param().