$get_names = mysql_query("SELECT `name` FROM `users`"); // ВЫВОДИМ СПИСОК ИМЁН while($name = mysql_fetch_row($get_names)) { if(isset($name[0])) { echo $name[0]."<br>"; // выводит имена пользователей } } // ВЫВОДИМ СПИСОК ИМЁН ЕЩЁ РАЗ while($name = mysql_fetch_row($get_names)) { if(isset($name[0])) { echo $name[0]."<br>"; // здесь ничего не выводится.. } } Why the data is not displayed in the second cycle?
mysql_fetch_rowjust gets the next record, not the past ones. To reset the record pointer in your case, you must use mysql_data_seek . Then you will again be at the top of the list and will be able to usemysql_fetch_rowagain - BOPOHmysql_is outdated, you need to get rid of it (at least replace it withmysqli). And the approach with rewinding results is dubious. It is better to get a set of records, and then use it already - BOPOHmysql_*DECLINED !!! Use at leastmysqli_*functions. - Visman pm