I want to output the results of a query in text on a page so I can see what it looks like. Problem is that I am receiving errors if I use an echo like I did below or even use a print.
The error I am receiving is something about not being able to convert an object into a string
My question is what is best way to output query results on the page?
Below is the code:
$answersql = "INSERT INTO Answer (Answer)
VALUES (?)";
if (!$insertanswer = $mysqli->prepare($answersql)) {
// Handle errors with prepare operation here
}
$insertanswer->bind_param("s", $_POST['value'][$i]);
//$insertanswer->execute();
echo $insertanswer;
if ($insertanswer->errno) {
// Handle query error here
}
$insertanswer->close();
__toStringmethod that returns a string, but I don't think that's what you actually need here. What errors are you getting?