Jump to content

retreive user specific info from mysql after login


tai

Recommended Posts

Hi,

I was wondering if I can get advise on how to pursue this:

I have a db with a various user tables and various fields. I would like to have a user login and see only their specific data.

I have seen innumerable login scripts, but I am overwhelmed. I am looking for the simplest solution. Could I create some kind of filter that would look for a field usr and a field pass that would spit out the user record that matched those? Hmm. Any friendly advice?

 

Thanks alot,

tai

create a USER table.

 

once establish the connection for DB, use this 1 to retrieve the user record.

 

<?php
$sql=" SELECT * FROM user WHERE userid='$userid' ";
$result=mysql_query($sql);
$row=mysql_fetch_array($result, MYSQL_ASSOC);

$first_name=$row['first_name'];
$last_name=$row['last_name'];
$password=$row['password'];

echo $first_name;
echo $last_name;
?>

 

hope this help.:)

 

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.