Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

9. Binary Objects and Image Loading > Your Binary Data Isn’t Safe to Insert…Yet

Your Binary Data Isn’t Safe to Insert…Yet

So things look pretty good…but if you run the code from the previous section, you’ll have some issues. First and foremost, that binary data has all sorts of weird characters on which PHP and MySQL are going to choke. There’s actually always the possibility of running into characters that are a problem, but that’s especially true—and almost always the case—when you’re dealing with binary data.

Once again, though, there’s a utility function for that.

Note

You’ve probably noticed that at almost every turn, there’s a PHP utility function. That’s one of the advantages of a language that’s fairly mature. Well into version 4 and 5, PHP has settled and developed a pretty robust library of handy functions like getimagesize and the one you’re about to use, mysql_real_escape_string.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint