<?php set_time_limit(0); //Base $host = 'localhost'; $user = 'root'; $pass = ''; $db = 'test'; $conn = mysql_connect($host, $user, $pass); mysql_select_db($db); // $bla = "CREATE TABLE `bla` ( `id` int(3) NOT NULL auto_increment primary key, `text` text NOT NULL )"; mysql_query($bla); $test = file_get_contents('a.txt'); $tes = explode('- NEW -', $test); for ($i = 1; $i < count($tes); $i++) { mysql_query("INSERT INTO `bla` (`text`) VALUES ('$tes[$i]')"); } echo '<h1>Готово</h1>'; ?>
@mysql_query('SET NAMES cp1251');