Jump to content

[SOLVED] Fetch data and display


daveoffy

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 }

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.