Calling only one row of a table.

I have created a db which includes a user_id for login. What I would like to happen is for the user to login and they go to their page with their info on it. I can get it to go to their page but not show just the login user’s info.

This is what I have.

<? /*if(!$auth=="ok") { header ( "Location:login.html"); exit; } */ $id=="id"; ?> <?php $host="localhost"; $username="beylah"; $password="******"; $db_name="students"; $tbl_name="team_users"; mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $sql="SELECT * FROM $tbl_name"; $result=mysql_query($sql); ?>

Is that all you’re doing? You’re going to have to print/echo the results of the query for it to show up.

ok here is all the code - including the echo

[code]<?

/*if(!$auth==“ok”)
{
header ( “Location:login.html”);
exit;
}
*/
$id==“id”;
?>

<?php $host="localhost"; $username="beylah"; $password="*****"; $db_name="students"; $tbl_name="team_users"; mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $sql="SELECT * FROM $tbl_name"; $result=mysql_query($sql); ?> T.E.A.M.



Welcome <? echo $rows['FIRST_NM']; ?>



Bank Account:

<? echo $rows['BANK']; ?>






View Profiles

<? echo $rows['FIRST_NM']; ?>'s
Profile
Senior Mentor
Profile
Jenior Mentor
Profile
[/code]

MOD EDIT: Added code tags

You’re using $rows array without initializing it. Are you forgetting a mysql_fetch_assoc() somewhere?

forgetting - no - not knowing to - yes

so i need to add

mysql_fetch_assoc()

mysql_fetch_assoc(), for all your questions and issues :)

Sponsor our Newsletter | Privacy Policy | Terms of Service