Hello,

I Tried this
I could not get any thing.

$sql = "SELECT * FROM {test} WHERE uname="$user->name"";
$results = db_query($sql);
while ($fields = db_fetch_array($results)) {
echo "

";
foreach($fields as $key => $value) {
echo "$key = $value\n";
}
echo "

";
}
}
else {
print t('this is else statement.');
}
?>

How to use the Php variable in SQL Query

==========
How to fetch the Database table fields with specific user ID.

Scenario is: There is a table of data with Primary Key is User ID with other fields in the table, once the user logged in user able to fetch the data from table in the row of UID display for respective user in table format.

Thanks in advance