RobberBaron Posted September 12, 2010 Share Posted September 12, 2010 I want to be able to output a picture from a database in a PHP script. I've managed to do this with a file, so I know the headers and such, but what sort of thing would I use? I already know how to start a MySQL connection, but even so I'm pretty sure you couldn't just echo the field. Can you help please? Link to comment Share on other sites More sharing options...
wirehopper Posted September 12, 2010 Share Posted September 12, 2010 Is the image stored in the database or on the filesystem?Images are usually best stored in files, rather than in the database. Link to comment Share on other sites More sharing options...
Synook Posted September 12, 2010 Share Posted September 12, 2010 There are some advantages to storing binary data in databases, depending on the application. Anyway, the answer is yes, you can just print it out. Link to comment Share on other sites More sharing options...
RobberBaron Posted September 12, 2010 Author Share Posted September 12, 2010 Yes, say if you have an application where people upload pictures so that they can be used as trusted resources then it would be better to save them to the database, rather than having a whole folder for each account.Anyway thanks, works fine Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.