Jump to content

Profile page


Colourtheory

Recommended Posts

So I tried to make a profile page.. it's not working out so well. Here is the profile page's source, and note: the address bar when you click the link comes out to be ?id= and even if I type the ?id=1 it still doesn't work <?phpsession_start();require_once 'db.php'; $id = $_GET['id'];$user = mysql_query("SELECT name FROM users WHERE id='$id'"); echo "<h1>User Info</h1>"; echo "<p>Username:" . $user['name'] . "<br>";echo "Email:" . $user['email'] . "<br>"; ?>

Link to comment
Share on other sites

Hiyou are only quering not fetching value from the database do something like this after quering $user = mysql_query("SELECT name FROM users WHERE id='$id'");$result = mysql_fetch_assoc($user);echo "<p>Username:" . $result['name'] . "<br>";echo "Email:" . $result['email'] . "<br>";

Edited by nitesh
Link to comment
Share on other sites

 <?phpsession_start();require_once 'db.php';$id = $_GET['id'];$user = mysql_query("SELECT name FROM users WHERE id='$id'");$result = mysql_fetch_assoc($user);$email = $result['email'];echo "<p>Username: " . $result['name'] . "<br>";echo "Email:" . $result['email'] . "<br>"; ?>

Still not working.. hmm..

Edited by Colourtheory
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...