My SKrafty

[php]
$current_user = wp_get_current_user();
/**
* @example Safe usage: $current_user = wp_get_current_user();
* if ( !($current_user instanceof WP_User) )
* return;
*/
echo ‘Username: ‘ . $current_user->user_login . ‘
‘;

echo ‘
‘;
echo ‘User email: ‘ . $current_user->user_email . ‘
‘;
echo ‘User first name: ‘ . $current_user->user_firstname . ‘
‘;
echo ‘User last name: ‘ . $current_user->user_lastname . ‘
‘;
echo ‘User display name: ‘ . $current_user->display_name . ‘
‘;
echo ‘User ID: ‘ . $current_user->ID . ‘
‘;
$username = $current_user->user_login;
echo ‘
‘;
echo ‘User ID: ‘ . $username . ‘
‘;
echo $username;

$con=mysqli_connect(“minecraft.skrafty.com”,”chatlog”,”chatlog”,”chatlog”);
// Check connection
if (mysqli_connect_errno())
{
echo “Failed to connect to MySQL: ” . mysqli_connect_error();
}

$result = mysqli_query($con,”SELECT * FROM messages WHERE name=’$username'”);

echo “[table border=’1’]
[tr]
[th]name[/th]
[th]message[/th]
[/tr]”;

while($row = mysqli_fetch_array($result))
{
echo “[tr]”;
echo “[td]” . $row[‘name’] . “[/td]”;
echo “[td]” . $row[‘message’] . “[/td]”;
echo “[/tr]”;
}
echo “[/table]”;

[/php]

Bookmark (0)
Please login to bookmarkClose