$lines = file('array2.txt');
foreach($lines as $line)
{
mysql_query("INSERT INTO test (Tweet, Date) VALUES ('$line', '22')");
}
Hi All,
I am trying to use the code above to use the file() function to add lines from a text file into an array, so I can then place it in a mysql database. The file I am using contains a 100 lines, but using the function above I end up with over 116,000. Does anyone known how what is causing this? Thank you in advance.
mysql_*functions are deprecated in PHP 5.5. It is not recommended for writing new code as it will prevent you from upgrading in the future. Instead, use either MySQLi or PDO and be a better PHP Developer.RT @_LiftedTrucks_: #Ford http://t.co/cnrr RT @_LiftedTrucks_: #Ford http://t.co/cnrr ‚Äö√Ñ√∫@_LiftedTrucks_: #Ford http://t.co/iYUIAZp7hb‚ "@_LiftedTrucks_: #Ford http://t.co/F4FRMbMqC4" I want this @baileThis is a few lines from the file.