Jump to content

[SOLVED] How do I Extract data from the Members only section


stuart7398

Recommended Posts

Hi.

I have a members area.

When the member logs in, they see links to their respective pages – 'My Profile', and so on.

 

I want the user to view their own personal profile / space / settings taken from the database.

What do I use to achieve this?

 

Thanks,

Stuart.

 

 

<?php
require_once('auth.php');
?>

<?php $page_title = 'My Profile'; @ require_once ('../includes/head.php'); ?>
<div class="members_nav"><a href=" member-homepage.php">My Homepage</a>  | <a href=" member-profile.php">My Profile</a> | <a href=" member-pictures.php">My Pictures</a> | <a href=" logout.php">Logout</a></div>
<?php
require '../conn/config.php';
require '../conn/opendb.php';
$data = mysql_query("SELECT * FROM `members` ORDER BY member_id") OR DIE (mysql_error());
$info = mysql_fetch_array( $data );
{
Print "<p><br /><h1>Welcome Back ".$info['firstname']."</h1></p>";
}
?>

</div></div>
<?php 
@ require_once ('../includes/leftnav.php'); 
@ require_once ('../ includes /rightnav.php'); 
@ require_once ('../ includes /foot.php'); 
?>

Link to comment
Share on other sites

Im honestly not sure. I've been learning only for about 12 weeks.

Any help appreciated.

thanks.

 

WHERE added below

 

<?php

require '../connect/config.php';

require '../connect/opendb.php';

$data = mysql_query("SELECT * FROM members WHERE member_id = '$id'") OR DIE (mysql_error());

$info = mysql_fetch_array( $data );

{

Print "<p><br /><h1>Welcome Back ".$info['firstname']."</h1></p>";

}

?>

Link to comment
Share on other sites

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.