php-windows Digest 13 Aug 2013 07:08:25 -0000 Issue 4133
Topics (messages 31106 through 31107):
Performance/handling limit on mysqli_real_escape_string() function?
31106 by: Jacob Kruger
31107 by: Pierre Joye
Administrivia:
To subscribe to the digest, e-mail:
php-windows-digest-subscr...@lists.php.net
To unsubscribe from the digest, e-mail:
php-windows-digest-unsubscr...@lists.php.net
To post to the list, e-mail:
php-wind...@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
What with trying to store image data in mySQL database, I am saving the results
of fread() function carried out using the file handle returned from fopen(),
with the "rb" argument to tell it the file is for binary reading.
Either way, for example, this specific image file is a 2.1Mb PNG file, and
mySQL server on my local, windows development machine seems to lock up
roundabout when I tell it to carry out the mysqli_real_escape_string() function
on the value of the variable that now contains the data read from the
physically uploaded file, and just wondering if this could be something like a
process overload, etc., and whether should just try taking out the string real
escaping for now, or whether that's likely to cause problems, or should I try
something like splitting the file's data into more manageable size chunks,
carry out the string escaping on those chunks one at a time, with even a
possible form of pause inbetween, and then re-append them together before
writing them to the database, or should I maybe just implement at least a form
of file size limit, which might be an issue if the user will insist on certain
image sizes, resolutions, etc. etc.?
Thoughts/suggestions?
TIA
Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'
--- End Message ---
--- Begin Message ---
hi!
On Mon, Aug 12, 2013 at 11:24 PM, Jacob Kruger <ja...@blindza.co.za> wrote:
> What with trying to store image data in mySQL database, I am saving the
> results of fread() function carried out using the file handle returned from
> fopen(), with the "rb" argument to tell it the file is for binary reading.
>
> Either way, for example, this specific image file is a 2.1Mb PNG file, and
> mySQL server on my local, windows development machine seems to lock up
> roundabout when I tell it to carry out the mysqli_real_escape_string()
> function on the value of the variable that now contains the data read from
> the physically uploaded file, and just wondering if this could be something
> like a process overload, etc., and whether should just try taking out the
> string real escaping for now, or whether that's likely to cause problems, or
> should I try something like splitting the file's data into more manageable
> size chunks, carry out the string escaping on those chunks one at a time,
> with even a possible form of pause inbetween, and then re-append them
> together before writing them to the database, or should I maybe just
> implement at least a form of file size limit, which might be an issue if the
> user will insist on certain image sizes, resolutions, etc. etc.?
>
> Thoughts/suggestions?
Not really windows specific, php-database could fit better for this
question but here is what you should do:
https://blogs.oracle.com/oswald/entry/php_s_mysqli_extension_storing
Cheers,
--
Pierre
@pierrejoye | http://www.libgd.org
--- End Message ---