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'); 
?>

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>";

}

?>

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.