heres the background, i have a session var created at login page (username) when the person is authenticiated its says hello 'yourname'
ok cool, thats what i wanted, now im going a little more in-depth
i want to be able to tell the user all of there information stored in my mysql database (login_DB)
heres the code:
Code: Select all
<?php
// database variables for connections
$host = "localhost";
$user = "malcolmboston";
$password = "xxxxx";
$DBname = "TDN";
$tablename = "login_DB";
//connection variables completeed
// establishing connections
$link = mysql_connect ($host, $user, $password);
//connection established
//the query defined
$query = "select * from $tablename";
//the result
$result =mysql_db_query($DBname, $query, $link);
echo $result;
?>here what i want but the syntax is wrong and i cant find anything about it, anyone know the proper coding?
Code: Select all
$query = "SELECT password from $tablename WHERE username = $_SESSION['username']";