Better would be the use of WordPress’ function get_posts():
$args = array(
'post_type' => 'post',
'post_status' => 'publish'
);
$posts = get_posts( $args );
echo '<ul>';
foreach ( $posts as $post ) {
echo '<li>' . $post->post_title . '</li>';
}
echo '</ul>';