Re: [PHP-DB] Saving Image in mySQL

2013-03-20 Thread Gavin Chalkley
I am with Karl on this. Storing an image in the db is very heavy on lpad times. Upload the image to a folder with name saved with location On Mar 19, 2013 11:12 PM, Karl DeSaulniers k...@designdrumm.com wrote: Hey Ron, I don't know how others feel, but I say save yourself a headache and dont

Re: [PHP-DB] Saving Image in mySQL

2013-03-20 Thread Karl DeSaulniers
Ron, If your hell bent on storing the image data. :P I would say base64 the data and use a blob or text then read it out using something like.. $image = 'img src=data:'.$image_data.' /'; echo($image); I would also say your individual image max size should be 50k or less. If your storing product

Re: [PHP-DB] Saving Image in mySQL

2013-03-20 Thread Toby Hart Dyke
You're right - you're pulling $file out of thin air. Once uploaded, the file is stored in $_FILES['file']['tmp_name'], and you need to manually read the data into $file yourself. Something like: file_get_contents($_FILES['file']['tmp_name']) Toby On 3/19/2013 8:15 PM, Ron Piggott

Re: [PHP-DB] Saving Image in mySQL

2013-03-20 Thread Jim Giner
Absolutely - do not store any images in a db. Makes no sense. The data (the image) is static, basically safe from alteration or changing in any way, so what is the need? Save the location/name of the image only and store all of them in one (or more) secured folders on the server. No db

Re: [PHP-DB] Saving Image in mySQL

2013-03-20 Thread Jim Giner
On 3/20/2013 8:43 AM, Toby Hart Dyke wrote: You're right - you're pulling $file out of thin air. Once uploaded, the file is stored in $_FILES['file']['tmp_name'], and you need to manually read the data into $file yourself. Something like: file_get_contents($_FILES['file']['tmp_name'])

[PHP-DB] Saving Image in mySQL

2013-03-19 Thread Ron Piggott
Hi All I don’t understand how to save an image to a mySQL table based on the following form. I am trying to do this using Prepared Statements. All the fields except the image file itself save in the database. Right now I have $file as the variable when binding the values. What should it be?

Re: [PHP-DB] Saving Image in mySQL

2013-03-19 Thread Karl DeSaulniers
Hey Ron, I don't know how others feel, but I say save yourself a headache and dont store the image data, just the url to the image on the server. image_url – VARCHAR 100 Best, Karl On Mar 19, 2013, at 3:15 PM, Ron Piggott wrote: Hi All I don’t understand how to save an image to a mySQL