Hello all....i just wanna ask maybe a simple question.....here it is...i
have develop one system..using php ,mysql...and have multiple user login to the system..and..what i want is, after the user log in, all the detail about the logged user would be retrieve in another page based on log in detail that user enter earlier.... so that user do not have to search for their detail again after log in....

i have 3 different table to retrieve the detail from

how do i do it?
pleezz..help...i juz have 2 more days left to finish this system:'(

Recommended Answers

All 2 Replies

Hey,

You can make a database request based on what the user enters in your login form. For example, if the user enters their username to login, you could say something like:

// Get Username from login form. This could be an email address or
// another type of login information...
$loginname = $_POST['NameofLoginField'];

$query = "SELECT * FROM users WHERE username = '$loginname'";

// Perform Query
$result = mysql_query($query);

// Check result
// This shows the actual query sent to MySQL, and the error. Useful for debugging.
if (!$result) {
    $message  = 'Invalid query: ' . mysql_error() . "\n";
    $message .= 'Whole query: ' . $query;
    die($message);
}

//use result
while ($row = mysql_fetch_assoc($result)) {
    echo $row['firstname'];
    echo $row['lastname'];
    echo $row['address'];
    echo $row['age'];
}

Hope that helps

nonshatter,

thanks so much for your reply.....this should help me much.....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.