开发者

PHP mysqli updating a blob value in table does nothing

开发者 https://www.devze.com 2022-12-21 09:49 出处:网络
I have a variable called $description that has a paragraph of information in it. Some of these descriptions are a sentence or 2, some are long, so im using blobs to save this instead of var char. This

I have a variable called $description that has a paragraph of information in it. Some of these descriptions are a sentence or 2, some are long, so im using blobs to save this instead of var char. This statement executes without a problem, but nothing actually gets saved. No errors reported.

$query = "UPDATE event SET description=? WHERE id开发者_StackOverflow社区=? LIMIT 1";
if($stmt = $db -> prepare($query))
{
    $null = NULL;
    $stmt -> bind_param("bi", $null, $id);
    $stmt -> send_long_data(0, $description);
    $stmt -> execute();
}

Is there something im missing?


Instead of binding b as blob, try to refer to s as string

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号