<?php
$content = file_get_contents("a.txt");
$lines = explode("\n", $content);
foreach ($lines as $line) {
$row = explode(":", $line);
$query = "INSERT INTO tablename SET val1 = '" . trim($row[0]) . "', val2 = '" . trim($row[1]) . "'";
mysql_query($query);
}
?>
Php : File insert mysql
- Détails
- Écrit par : Richard GAUTHIER
- Clics : 2810