jerry89 Posted March 31, 2009 Share Posted March 31, 2009 (it might be a stupid question , I apologize in front) I want to insert image into sql/database.. by field in form.. something like upload to the server.. but in database in this matter. and then you echo it out ? is it possible ? Link to comment https://forums.phpfreaks.com/topic/151898-can-sqldatabase-do-this/ Share on other sites More sharing options...
gnawz Posted March 31, 2009 Share Posted March 31, 2009 Yes it is.. First u upload to server... Then u save to database Link to comment https://forums.phpfreaks.com/topic/151898-can-sqldatabase-do-this/#findComment-797635 Share on other sites More sharing options...
jerry89 Posted March 31, 2009 Author Share Posted March 31, 2009 okies... let's say.. "when you create new user, i will make field, that is for upload / it will be linked to the database that is created for it".. This should work , right ? Link to comment https://forums.phpfreaks.com/topic/151898-can-sqldatabase-do-this/#findComment-797637 Share on other sites More sharing options...
RichardRotterdam Posted March 31, 2009 Share Posted March 31, 2009 In mysql you can use the blob type to directly store an image into a database. You should ask yourself if this is what you want though. A common practice is storing just the image url in a database instead of the whole thing. Link to comment https://forums.phpfreaks.com/topic/151898-can-sqldatabase-do-this/#findComment-797643 Share on other sites More sharing options...
jerry89 Posted March 31, 2009 Author Share Posted March 31, 2009 it will be basically just one image as to show profile.. or which othery way I can do it? Link to comment https://forums.phpfreaks.com/topic/151898-can-sqldatabase-do-this/#findComment-797660 Share on other sites More sharing options...
RichardRotterdam Posted April 1, 2009 Share Posted April 1, 2009 In your case it might be better to store the image name as string in a dbfield. Then upload the actual image in a folder on the server. Link to comment https://forums.phpfreaks.com/topic/151898-can-sqldatabase-do-this/#findComment-798458 Share on other sites More sharing options...
kev wood Posted April 1, 2009 Share Posted April 1, 2009 you will need to resize the images that are uploaded also in a way that they are not distorted. i have a php image upload script which resizes the image without distorting it and stores the url to the image in a db and also stores to copies of it on the server. would you like this script? Link to comment https://forums.phpfreaks.com/topic/151898-can-sqldatabase-do-this/#findComment-798503 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.