Re: Anyone tried a MySQL load data infile statement?
| From: | JJeffman | Date: | Wed, 28 Feb 2001 15:05:42 +0000 |
| Subject: | Re: Anyone tried a MySQL load data infile statement? | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-7020@lists.php.net to get a copy of this message | ||
The statement exists in MySQL and as far as I know works perfectly.
I couldn't try it because my ISP had disabled it for security matters. But
it works as described on the MySQL manual .
HTH.
Jayme.
-----Mensagem Original-----
De: Miles Thompson <milesthompson@ns.sympatico.ca>
Para: <php-db@lists.php.net>
Enviada em: terça-feira, 27 de fevereiro de 2001 19:58
Assunto: [PHP-DB] Anyone tried a MySQL load data infile statement?
> In the Python language, witht he appropriate module, one can construct a
> string like:
>
> "load data infile 'pwlist.txt' replace into table subscriber fields
> terminated by '\t' optionally enclosed by '"' lines terminated by
> '\r\n'
",
>
> pass it to the cursor.execute() function and it completes.
>
> I've tried this, assingning the string to $sql, and then issuing
> mysql_query( $sql ), all in the hope that magic would happen. It hasn't. I
> guess what I was sort of counting on was that mysql_query(), despite its
> name and obvious function might also be a general purpose execution tool
> for MySQL commands.
>
> Anyone tried anything similar? It's a really cool way to quickly update a
> database from a, in this case, tab-delimited file.
>
> Miles Thompson
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>