Welcome, Guest. Please login or register.
Did you miss your activation email?
News: Welcome to eMoneySpace! Nov 28, 2022 12:13 pm

A users php code
Author Topic: A users php code  (Read 732 times)
Reputation: (0)


Gender: Male
Posts: 132
Referrals: 0

View Profile WWW
Apr 23, 2010 09:08 am

I'm trying to create a php code through which the details of a user who is logged in can be shown. For example, I have the age of a user and when he logs in, I want it to be shown in his profile.

Here's a code but its only for a single user whose details will be shown to every user:

$con = mysql_connect("localhost","peter","abc123");
if (!$con)
  die('Could not connect: ' . mysql_error());

mysql_select_db("my_db", $con);

$result = mysql_query("SELECT * FROM Persons
WHERE FirstName='Peter'");

while($row = mysql_fetch_array($result))
  echo $row['FirstName'] . " " . $row['age'];
  echo "<br />";

Any help?
« Last Edit: Apr 23, 2010 09:12 am by nightlocker » Logged

Jump to:  
Copyright © 2008-2022 eMoneySpace. All rights reserved.