0

I've got a raw/(binary?) image like this:

ÿØÿà�JFIF��–�–�*!!!$'$ &(goes on forever);

when i try to insert this into mysql it doesn't work, the column type is set to longblob, any ideas?

3
  • What is the encoding of your database? Commented Sep 12, 2009 at 6:21
  • 1
    Show us your php code and we may be able to provide more insight Commented Sep 12, 2009 at 6:24
  • i can't set the encoding for a longblob, but karim79's solution worked perfectly. Commented Sep 12, 2009 at 6:26

2 Answers 2

3

I think you need to escape that using mysql_real_escape_string before inserting into the database.

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

Comments

0

mysql_real_escape_string for php_mysql
mysqli_real_escape_string or prepare statement for php_mysqli

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.