I am trying to create script that will import data into my database from a URL. It is working but I need it to ignore the first 6 lines. I am not sure how to do that so if anyone could help I would appreciate it...
Here is what I got so far.
(I am not that advanced in PHP so details would be helpful)
Thank YouPHP Code:<?
$data=file("http://www.blah-blah-blah.com/file.txt");
foreach($data as $value)
{
$fields=explode("\t",$value);
$num=count($fields);
for ($n=0;$n<$num;$n++)
{
$null="";
print ($n==0) ? "<b><font face=arial size=1>IMPORTING...></font></b><BR>" : $null;
}
include("../config.php");
//set_time_limit(0); - not needed yet
// Insert into categories table here
mysql_query("INSERT into products2 (name,keywords) VALUES ('$fields[0]','$fields[1]')");
}
?>![]()



)


Bookmarks