Read file line by line and save one line in database row
<p>I cant uderstand how to save one line in database...
I have file from web and i take him with CURL. That file look like this:</p>

<p>www.example.com/file.txt</p>

<blockquote>
  <p>REFALIAS    http://<em>.example.com/data/</em>/*    <a href="http://example.com/data/?q=" rel="nofollow">http://example.com/data/?q=</a>$2 </p>
  
  <p>REFALIAS    http://<em>.example.com/data/</em>/*    <a href="http://example.com/data/?q=" rel="nofollow">http://example.com/data/?q=</a>$2 </p>
  
  <p>REFALIAS    http://<em>.example.com/data/</em>/*    <a href="http://example.com/data/?q=" rel="nofollow">http://example.com/data/?q=</a>$2 </p>
  
  <p>REFALIAS    http://<em>.example.com/data/</em>/*    <a href="http://example.com/data/?q=" rel="nofollow">http://example.com/data/?q=</a>$2 </p>
</blockquote>

<p>All contnten from web i take with CURL and save in new file in my web root dir...
Now am confused with saving lines in database.</p>

<p>My DB shema look like this:</p>

<pre><code>ID  |   TYPE        |   LINK_ONE                      |  LINK_TWO
--------------------------------------------------------------------------------------
 1  |  REFALIAS     |  http://*.example.com/data/*/*  | http://example.com/data/?q=$2
 2  |  REFALIAS     |  http://*.example.com/data/*/*  | http://example.com/data/?q=$2
 3  |  REFALIAS     |  http://*.example.com/data/*/*  | http://example.com/data/?q=$2
</code></pre>

<p>I try this:</p>

<pre><code>&lt;?php     
$fp = @fopen('myFile.txt', 'r');
    while(!feof($fp)) {
       $buffer = fwrite($fp, 999);
       list($type, $link_one, $link_two) = explode("\n", $buffer);
       mysql_query('INSERT INTO table ('type', 'link_one','link_two' VALUES("{$type}, {$link_one}, {$link_two}");
    }
?&gt;
</code></pre>

<p>This back Notice: Undefined offset: 2;
I try to many examples like this and i cant save all each lines in db.
I must take line by line and save. 
I take success with only explode but how to separate all...</p>

<p>Any example for this</p>
