Skip to content

Instantly share code, notes, and snippets.

Created January 5, 2014 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/8268156 to your computer and use it in GitHub Desktop.
Save anonymous/8268156 to your computer and use it in GitHub Desktop.
<?php
$result = $db->query('SELECT
wp1.meta_value AS first_name,
wp2.meta_value AS last_name
FROM
wp_usermeta wp1
INNER JOIN
wp_usermeta wp2
ON ( wp1.user_id = wp2.user_id )
WHERE
wp1.user_id = 19
AND wp1.meta_key = "first_name"
AND wp2.meta_key = "last_name"');
while ($row = $result->fetch_array()) {
echo $row['first_name'] . PHP_EOL;
echo $row['last_name'] . PHP_EOL;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment