List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:December 15 1999 2:31pm
Subject:Re: .PNG files stored in DB get messed up
View as plain text  
At 3:39 PM +0200 1999-12-15, <sinisa@stripped> wrote:
>Matthew Vanecek writes:
>  > sinisa@stripped wrote:
>  > >
>  > > One additional question:
>  > >
>  > > If you get bad data from mysql monitor program, have you escaped data
>  > > in your .PNG prior to inserting them ??
>  > >
>  > > Sinisa
>  > >
>  >
>  > No--I uploaded the files via Perl's DBI, so perl took care of that part
>  > (I hope?). As far as escaping a fairly large file (bitmap, png,
>  > whatever), what's the best way to do that? You'd have to go through some
>  > fancy fseeking and mallocing and whatnot to get the data into a variable
>  > of the right size, I would think, and then run it through mysql_escape
>  > or whatever.  Probably will write a proggie to do that, just for fun,
>  > esp. since I probably won't be gettin 3.23.x w/load_file anytime soon.
>  >
>
>So , that is a mistake !!!!! DBI, as far as I know, does not take care
>of it automatically. MySQL++, on the other hand DOES take care of it
>automatically.

DBI takes care of it automatically if you use placeholders.

If you don't use placeholders, the quote() method will convert the value
properly for direct insertion into the query string.

-- 
Paul DuBois, paul@stripped
Thread
.PNG files stored in DB get messed upMatthew Vanecek12 Dec
  • Re: .PNG files stored in DB get messed upsinisa12 Dec
  • Re: .PNG files stored in DB get messed upMatthew Vanecek12 Dec
    • Re: .PNG files stored in DB get messed upsinisa13 Dec
  • Re: .PNG files stored in DB get messed upMatthew Vanecek13 Dec
    • Re: .PNG files stored in DB get messed upsinisa14 Dec
    • Re: .PNG files stored in DB get messed upsinisa14 Dec
  • Re: .PNG files stored in DB get messed upMatthew Vanecek14 Dec
  • Re: .PNG files stored in DB get messed upMatthew Vanecek15 Dec
    • Re: .PNG files stored in DB get messed upsinisa15 Dec
      • Re: .PNG files stored in DB get messed upPaul DuBois15 Dec
  • Re: .PNG files stored in DB get messed upMatthew Vanecek15 Dec
    • Re: .PNG files stored in DB get messed upsinisa15 Dec
  • One database can have how many tables?xu15 Dec
    • Re: One database can have how many tables?Charles Kirby15 Dec
      • Re: One database can have how many tables?Sasha Pachev16 Dec
        • Re: One database can have how many tables?Michael van Elst16 Dec
          • Re: One database can have how many tables?Michael van Elst16 Dec
      • Re: One database can have how many tables?Sasha Pachev16 Dec
        • Re: One database can have how many tables?Michael van Elst16 Dec
  • Re: .PNG files stored in DB get messed upMatthew Vanecek16 Dec
    • Re: .PNG files stored in DB get messed upsinisa16 Dec
  • Re: .PNG files stored in DB get messed upMatthew Vanecek16 Dec
    • Re: .PNG files stored in DB get messed upChristopher E. Brown16 Dec
      • Re: .PNG files stored in DB get messed upMatthew Vanecek16 Dec
        • Re: .PNG files stored in DB get messed upChristopher E. Brown17 Dec
          • Re: .PNG files stored in DB get messed upMatthew Vanecek18 Dec
            • Re: .PNG files stored in DB get messed upChristopher E. Brown18 Dec
            • Re: .PNG files stored in DB get messed upsinisa18 Dec
              • Re: .PNG files stored in DB get messed upChristopher E. Brown20 Dec
  • Re: .PNG files stored in DB get messed upMatthew Vanecek16 Dec
    • Re: .PNG files stored in DB get messed upsinisa17 Dec
  • Re: .PNG files stored in DB get messed upMatthew Vanecek18 Dec
    • Re: .PNG files stored in DB get messed upsinisa18 Dec
  • Re: .PNG files stored in DB get messed upMatthew Vanecek19 Dec
  • Re: .PNG files stored in DB get messed upMatthew Vanecek3 Jan
    • Re: .PNG files stored in DB get messed upsinisa3 Jan