FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » is mysqli_real_escape_string bullet proof with binary data?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: is mysqli_real_escape_string bullet proof with binary data? [message #182307 is a reply to message #182282] Sun, 28 July 2013 00:01 Go to previous messageGo to previous message
Norman Peelman is currently offline  Norman Peelman
Messages: 126
Registered: September 2010
Karma:
Senior Member
On 07/27/2013 09:56 AM, Jerry Stuckle wrote:
> On 7/27/2013 9:35 AM, Norman Peelman wrote:
>> On 07/27/2013 05:31 AM, The Natural Philosopher wrote:
>>> The target is to create and store thumbnail PNG images in a Mysql table.
>>> Also any tips on actually getting the thumbnail data into a variable -
>>> which package is recommended? I've always used GD, but never been 100%
>>> happy with it
>>>
>>
>> Well, you don't sat why you don't like GD but that is what I use (on
>> one of my sites) so here is what I do---
>>
>> When writing *to* the database:
>> A) You have sql LOAD_FILE to store a file (filesystem) in the db.
>>
>> I write the GD image resource to a tmp file and then store it using
>> LOAD_FILE.
>>
>> imagepng($img, $destfile);
>> /* stuff */
>> $query = "UPDATE table SET img_data = LOAD_FILE('$destfile') WHERE ?"
>>
>
> No, you do NOT have to write the image to a temp file and use LOAD FILE.
> It can be written directly from the binary image in memory.
>


Thanks Jerry, never thought about trying that. My site only used
small images 10kb or less in size and I think I was either processing
them through shared memory (shm - linux) or I may have even just used
the images straight from the POST array (after some verification).
Probably not a good idea but I was just starting to learn PHP/MYSQL/HTML
at the time, not that I've mastered anything...


--
Norman
Registered Linux user #461062
-Have you been to www.php.net yet?-
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Major trouble with PhpDocumentor
Next Topic: Education Path to become a PHP developer using free online courses
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 21 20:34:54 GMT 2024

Total time taken to generate the page: 0.04354 seconds