1

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=? 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?

3
  • Have you checked that $id is a valid ID that exists in the database? In other words, is the WHERE clause actually matching a record? Commented Feb 22, 2010 at 21:42
  • Show us the actual SQL query that gets sent to the DB. Show us the results of that query if you run it from the mysql client. Showing us broken code with variables that are not known to us cannot help us fix the problem. Commented Feb 22, 2010 at 21:44
  • add echo $stmt->error; to the end of that to see what's going wrong with the execute. Commented Feb 23, 2010 at 0:05

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.