"John W. Holmes" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Five wrote: > > I have php code that takes text input from a webpage and and stores it in a mysql > > data base. > > I tried uploading small images (jpg) using basically the same syntax but they > > don't make it into the data base. > > Does anyone know of a simple tutorial that shows how to do this? > > although I'm against storing files in databases... > > $file = > mysql_real_escape_string(file_get_contents($_FILES['yourfile']['tmp_name'])); > $query = "INSERT INTO yourtable (imgdata) VALUES ('$file')"; > > -- > ---John Holmes... > > Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ > > php|architect: The Magazine for PHP Professionals www.phparch.com
Thanks, that seems to work. Although trying to retrieve them and show them in a browser shows characters / symbols instead. This kind of stuff: jw4ܭqHQI'[EMAIL PROTECTED] `*[#j q6є]Q.b (Y:9-"Ҫ(K\' EbXW(e 9ƛpEXal˵m8={xf Lye(5 PP3a o XD ~J VиܶF&7 c[3b䱄C&E -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php