Jump to content

Recommended Posts

First off my task is to fetch a 5 digit number from my database that got uploaded when users upload a picture so the picture name is in the database.

 

$row = mysql_fetch_array("SELECT picture_id from picture WHERE member_id = '{$_SESSION['SESS_MEMBER_ID']}'");
$abcd= $row['picture_id'];	
if (isset($_SESSION['SESS_MEMBER_ID'])) {  
    echo '<img src="/uploads/users/'.$abcd.'">';
}
else { BLAH BLAH NOT NEEDED }

 

I have connecting to database right but pulling data I don't. Table is picture, in table there is member_id and picture_id. The picture_id is what I want to display after /users/ so it displays their picture. Any questions about what I am asking just reply.

Link to comment
https://forums.phpfreaks.com/topic/134976-solved-fetch-data-and-display/
Share on other sites

just change ur Query like

 

$row = mysql_fetch_array("SELECT * from picture WHERE member_id = '{$_SESSION['SESS_MEMBER_ID']}'");

$abcd= $row['picture_id']; 

if (isset($_SESSION['SESS_MEMBER_ID'])) {

    echo '<img src="/uploads/users/'.$abcd.'">';

}

  else { BLAH BLAH NOT NEEDED }

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.