How to make a database query cyclic?

I am writing a base converter from dle->wordpress, simple, newsonly.
The question is – how to insert this piece of code into a loop so that it pulls out not only the first entry in the database, but everything? Do While(?);

//    DLE
    $db_dle = mysql_connect("localhost", "vf", "");
    mysql_select_db("vf", $db_dle);
    //    DLE
    $result_dle = mysql_query("SELECT * FROM  dle_post", $db_dle);
    $array_dle = mysql_fetch_array($result_dle);
    //    WP
    $db_wp = mysql_connect("localhost", "social", "");
    mysql_select_db("social", $db_wp);
    //    WP
    $addpost = mysql_query("INSERT INTO wp_posts (post_author, post_date, post_date_gmt, post_content, post_title, post_status, comment_status, ping_status, post_name, post_parent, menu_order, post_type) VALUES ('1', '$array_dle[date]', '$array_dle[date]', '$array_dle[short_story]', '$array_dle[title]', 'publish', 'open', 'open', '$array_dle[alt_name]', '0', '0', 'post')");
    echo $array_dle[title];
    echo " -  ";

Answer 1, authority 100%

Hmm… Or maybe it’s better not to write anything?

//    DLE
$db_dle = mysql_connect("localhost", "vf", "");
mysql_select_db("vf", $db_dle);
//    WP
$db_wp = mysql_connect("localhost", "social", ""); 
mysql_select_db("social", $db_wp);
//    DLE
$result_dle = mysql_query("SELECT * FROM  dle_post", $db_dle);
while($array_dle = mysql_fetch_array($result_dle)){
//    WP
$addpost = mysql_query("INSERT INTO wp_posts (post_author, post_date, post_date_gmt, post_content, post_title, post_status, comment_status, ping_status, post_name, post_parent, menu_order, post_type) VALUES ('1', '$array_dle[date]', '$array_dle[date]', '$array_dle[short_story]', '$array_dle[title]', 'publish', 'open', 'open', '$array_dle[alt_name]', '0', '0', 'post')");
echo $array_dle[title];
echo " -  ";
}