Jump to content

mysql_real_escape() and binary data


OldWest

Recommended Posts

ive been doing some research on this, and i cant seem to find an answer that makes sense.

 

im reading the manual on mysql_real_escape() and I know how to use the function, but in the description:

 

Escapes special characters in the unescaped_string, taking into account the current character set of the connection so that it is safe to place it in a mysql_query(). If binary data is to be inserted, this function must be used.

 

What is an example of inserting "binary data" as described above??

 

As far as I understand that would be any numerical values and a string would not apply.. But does not seem to add up. A binary file cannot be inserted, so Im a bit lost.

 

Any thoughts welcome.

Link to comment
Share on other sites

PFMaBiSmAd,

 

ok blob helps clear it up and from what i gather now the main difference is the binary data would be determined and evaluated based on byte value and standard character strings are evaluated based on their respective character encoding data..

 

I also realized i mean: mysql_real_escape_string() - I left out the "string" in my original question..

 

I guess I can't see having much use for a blob data type  :shrug: but I am open to realistic applicable  suggestions.

Link to comment
Share on other sites

For example, could the content of a Microsoft Word doc be inserted into a blob data type? And then used in MS Word format again from an external source? I am just trying to find some practical use for this binary data field type.

Link to comment
Share on other sites

I'm still open to any ideas on practical use of blob with php and mysql, but I read up some articles and found it appears the actual binary data (an image for example) can be stored in a blob data type.. If I understand this right, the blob content would just be a bunch of binary 0110101 data low level deconstruction of the image file, and then can be re encoded by some means.. Am I off on this? I'm sorry if this keeps bumping this is my last comment..

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.