how about this?
function jp_i_want_to_menu ($menuName) {
global $wpdb;
$pDB = $wpdb->posts;
$itemsWant = $wpdb->get_results("
SELECT p2.post_title, p2.guid
FROM $pDB p1
INNER JOIN wp_term_relationships AS TR
ON TR.object_id = p1.ID
INNER JOIN wp_postmeta AS PM
ON pm.post_id = p1.ID
INNER JOIN $pDB AS p2
ON p2.ID = PM.meta_value
WHERE p1.post_type = 'nav_menu_item'
AND TR.term_taxonomy_id = ( SELECT wp_terms.term_id FROM wp_terms WHERE wp_terms.slug = $menuName)
AND pm.meta_key = '_menu_item_object_id'
ORDER BY p1.menu_order ASC
");
if($itemsWant) {
foreach($itemsWant as $item)
echo '<option value="' . $item->guid . '">' . $item->post_title . '</option>';
}
}
From what I can tell making a custom menu adds extra (empty) rows in wp_posts ($pDB) that references the “real” page in the wp_postmeta table. So I inner joined the wp_postmeta table to your original query so it can get the original post data and not the added (empty) row data.