Jump to content

Recommended Posts

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

  ";

 

      } }

  }

?>

 

Link to comment
https://forums.phpfreaks.com/topic/194683-including-an-image-within-php/
Share on other sites

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!

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.