I think I understand.....
Your selecting info from a table, extracting it, and then displaying it, yes?
If that's the case, an example would be below......
$result = mysql_query("SELECT (blah) FROM (blah) WHERE (blah) = (blah);");
if(mysql_num_rows($result)) {
$r = mysql_fetch_array($result);
$Blah = $r[(blah)]; // Blah could be name (without the bracets)
echo $Blah;
Or I think you can echo it like this....
echo "$Blah = $r[(blah)];
Not too sure about that one.
Hope I helped,
~~Stereo