Tiruak Posted June 20, 2010 Share Posted June 20, 2010 Hello there, I've tried everything I can possible think of, and don't seem to get this to work. Once again, I'm new to php I have a database where I upload the user picture. I can get my form to upload and store the image on the database together with my user info. So now, when I try to echo the picture on my user profile, it just shows a bunch of invalid characters, probably due to a header problem. Now, maybe I'm missing the point here, but as far as I've learned, I need to call a header at the beginning of my script, before any html is displayed. But, if I do use something like // header('Content-type: image/jpg'); // at the beginning of my page, it actually makes all my page mess up, and still doesn't show the image. I'm contacting the database correctly, selecting the right user, storing all his info into my array, and trying to display the $user['usr_photo'] of my array. I appreciate any help. Link to comment https://forums.phpfreaks.com/topic/205301-display-image-from-mysql/ Share on other sites More sharing options...
Tiruak Posted June 20, 2010 Author Share Posted June 20, 2010 Can't edit anymore: Here is what I'm trying to do (the code is just an example, of course): <?php require_once("../includes/connection.php"); ?> <?php require_once("../includes/functions.php"); ?> <?php // header('Content-type: image/jpeg'); $sel_arb = get_arbitro_by_id($_GET['arb']); //echo $sel_arb['arb_photo']; ?> <html> <head> <title>The title is this</title> </head> <body> <table width=50%> <tr> <td>Name is <?php echo $sel_arb['arb_nome'];?></td> <td><?php echo $sel_arb['arb_photo'];?></td> </tr> </table> </body> </html> <?php require("../includes/footer.php"); ?> Link to comment https://forums.phpfreaks.com/topic/205301-display-image-from-mysql/#findComment-1074547 Share on other sites More sharing options...
thewooleymammoth Posted June 20, 2010 Share Posted June 20, 2010 did you try this http://www.phpriot.com/articles/images-in-mysql/8 ? Link to comment https://forums.phpfreaks.com/topic/205301-display-image-from-mysql/#findComment-1074555 Share on other sites More sharing options...
Tiruak Posted June 20, 2010 Author Share Posted June 20, 2010 did you try this http://www.phpriot.com/articles/images-in-mysql/8 ? I will give it another shot... I guess I need to stop cheering for Brazil in the world cup and close the door to concentrate. Link to comment https://forums.phpfreaks.com/topic/205301-display-image-from-mysql/#findComment-1074746 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.