I'm updating my PHP code from mysql to mysqli but I can't seem to find the answer to this question: Do mysqli update queries return a result?
With mysql, I could do
$result = mysql_query("UPDATE `data` SET `field1` = 1 WHERE `key` = '$mykey');
and $result would be true even though the query doesn't return any rows.
Now, though, in the mysqli code, I have something like this (error-handling removed for clarity):
$stmt = $mysqli->prepare("UPDATE `data` SET `field1` = 1 WHERE `key` = (?)")
$stmt->bind_param("s", $mykey);
$stmt->execute();
$result = $stmt->get_result();
and $result is false.
For the record, the query is valid (ignore any typos I may have made transcribing it into stackoverflow) and field1 is correctly updated in the database as expected. Also, get_result() works fine for select queries, so it's not a matter of get_result() not being available.
Basically, I just want to know if this changed behaviour is expected or if I should keep trying to find some bug somewhere.