Thank you so much for your valuable replies. Actually I have build a site in wordpress with buddypress. I have created a table in the database for any user logged in and attend a test in the site that table have been updated. Now, my requirement is I have created one menu for logged in user knowing his test result. When any logged in user click on that menu I want to show his details from that previous table. I have pasted my code below please support me for this issue. Thank you so much for your valuable support. I am trying to link up with wordpress default table column with my custom table column i.e., user email address, using email address in the mysql query i am trying to display current logged in user details.


$hostname = "localhost";
$db_user = "xxxxxxxxx";
$db_password = "xxxxxxxx";
$database = "xxxxxxxxxx";

$db_table = "dailychecklist";

$db = mysql_connect($hostname, $db_user, $db_password);

if (! $db) die(mysql_error());


global $current_user;
echo 'email: ' . $current_user->user_email . "\n";
$loggedemail = $current_user->user_email;

$result = mysql_query( "SELECT * FROM $db_table where email='$loggedemail'" )
or die("SELECT Error: ".mysql_error());
$num_rows = mysql_num_rows($result);
print "There are $num_rows records.<br>";

print "<table width=600 border=1>\n";
while ($get_info = mysql_fetch_row($result)){
print "<tr>\n";
foreach ($get_info as $field)
print "\t<td>$field</td>\n";
print "</tr>\n";
print "</table>\n";

Thanks in advance for your valuable support,