maxihobbs Posted March 9, 2010 Share Posted March 9, 2010 I'm trying to call each user's uploaded images from a database into my site for others to view. I currently have their personal information such as name and email which have been called from a MYSQL database, but I have no idea how to call each users separate images? Any ideas at all. My code for the page is here: <?php mysql_connect("localhost", "root", "") or die(mysql_error()); mysql_select_db("robinstalk") or die(mysql_error()); if (isset($_GET['member'])) { // connect to database. $sql = "SELECT * FROM users WHERE first = '{$_GET['member']}'"; $result = mysql_query($sql); if ($result) { if (mysql_num_rows($result) > 0) { $row = mysql_fetch_assoc($result); echo "<br /> <br /> First Name : {$row['first']} <br /> <br /> Last Name : {$row['last']} <br /> <br /> Email : {$row['email']} <br /> <br /> About : {$row['about']} <br /> <br /> Pictures: THIS IS WHERE IM STUCK AT WHAT TO PUT "; } } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/194683-including-an-image-within-php/ Share on other sites More sharing options...
PFMaBiSmAd Posted March 9, 2010 Share Posted March 9, 2010 Each image on a web page requires an <img src="URL_of_an_image" alt=""> HTML tag - http://w3schools.com/html/html_images.asp Quote Link to comment https://forums.phpfreaks.com/topic/194683-including-an-image-within-php/#findComment-1023834 Share on other sites More sharing options...
nafetski Posted March 9, 2010 Share Posted March 9, 2010 You can store the images in two ways #1 - As the path to your image on your webserver (highly recommend this) #2 - As binary data in your database. (highly do not recommend this) If you're doing it as #1 - you would do as the poster above said If you're doing #2 you should be beat with a hose filled with sand. Good luck! Quote Link to comment https://forums.phpfreaks.com/topic/194683-including-an-image-within-php/#findComment-1023888 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.