Jump to content

recognise a logged on user


freddyw

Recommended Posts

Try something similar to this:

 

$sql = "SELECT `firstName` FROM `users` WHERE `username`=" . $username;
$query = mysql_query($sql);
$fetch = mysql_fetch_assoc($query);
print($fetch['firstName']);

 

I think he needs a way to get users to log on first.

 

In that case, I suggest you check out this tutorial:http://fishbowl.pastiche.org/2004/01/19/persistent_login_cookie_best_practice/

no i already have users to log on

 

Use whatever method in your cookies/sessions that they log on with to fetch their information from the database:

 

Try something similar to this:

 

$sql = "SELECT `firstName` FROM `users` WHERE `username`=" . $username;
$query = mysql_query($sql);
$fetch = mysql_fetch_assoc($query);
print($fetch['firstName']);

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.