|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
loading images...
How do you save images to and load images from a mysql db? I'm really stuck here.
|
|
#2
|
|||
|
|||
|
RE: loading images...
I personally opt to not save images in the database. Instead I save them to a directory and save the filename of the image in mysql.
|
|
#3
|
|||
|
|||
|
RE: loading images...
1) Inserting images into database, field for storing image must be BLOB type: to choose image user: Upload.php <form name='MyForm' method=post enctype="multipart/form-data" action='Dofile.php'><input type=file name='userfile'><input type=submit value=Upload"> Dofile.php: $data = ""; $userfile = $HTTP_POST_FILES['userfile']['tmp_name']; //get file $fp = fopen($userfile, "rb"); while(!feof($fp)) { $data .= fread($fp, 1024); } fclose($fp); $data = addslashes($data); $data = addcslashes($data, " |