Pulling data from SQL, and writing to a text file

前端 未结 7 1164
广开言路
广开言路 2021-01-07 01:28

I am trying to pull data from SQL, and then write it to a text file. This does that, to an extent, but it only pulls 1 from the table, which reads test:test<

7条回答
  •  盖世英雄少女心
    2021-01-07 01:57

    If it's a text file, the
    tag will not be particularly useful to you, as well. You'll need to use \n to cause a newline to happen in a text file. If it was html, then we'd have a different situation.

    $accounts = "$user:$pass
    ";

    should be

    $accounts .= "$user:$pass\n";
    

    and you definitely should pull the file_put_contents out of the loop or you'll overwrite the file every time you go through the loop.

提交回复
热议问题