Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $host = "localhost";
- $user = "bolinha";
- $password = "";
- $db = "REMIX";
- $tabela = "TESTE";
- $conexao = mysql_connect($host, $user, $password) or die(mysql_error());
- $banco = mysql_select_db($db) or die(mysql_error());
- $arquivo = 'arquivo/teste.txt';
- $arq = fopen($arquivo,'r');
- while(!feof($arq))
- $linha[] = fgets($arq); // cria um array com o conteudo do arquivo
- $sql = "INSERT INTO '$tabela' (TESTE1, TESTE2, TESTE3) VALUES ('$linha[0]', '$linha[1]', '$linha[2]')";
- $result = mysql_query($sql) or die(mysql_error());
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement