Hello,
I would like to upload a file .txt
that meets the layout as follows (follow the example of two lines of the file):
9787546;488464;2016-12-11;Carlos Fonseca;carlos.fonseca
9787547;464664;2016-12-11;Rogério Barros;rogerio.barros
The file maintains this layout and has more than 3 thousand lines.
I would like to know more or less a script that treats the lines, differentiating in columns each data.
What I have currently simple, but only the first column imports:
<?php
$file = fopen('../files/docs/libs/newUsers.txt', 'r');
while(!feof($file)){
$data = fgets($file);
$query = mysqli_query($con,"insert into users values '({$data})'");
}
I know that no separation of the columns is being made, but it was the maximum I found at the moment.
I have not yet coded in OO.
Thank you!