I have the following, which works:
$sql = "SELECT * FROM SOMETABLE WHERE name='music'";
$stmt = $conn->prepare($sql);
$stmt->execute();
However, when I try to do it with variable binding, it does not:
$item_name = "music";
$sql = "SELECT * FROM SOMETABLE WHERE name='?'";
$stmt = $conn->prepare($sql);
$stmt->bind_param('s', $item_name);
$stmt->execute();
How can I go about figuring out why it doesn't?
source https://stackoverflow.com/questions/70883670/how-do-i-go-about-debugging-a-prepared-select-statement-with-variable-binding-my
No comments:
Post a Comment