Date: 06/13/02
- Next message: José Moreira: "[PHP-DB] how is it possible to read data from an excel workbook ?"
- Previous message: Bruce Vander Werf: "RE: [PHP-DB] Executing Queries from a File Using PHP"
- Maybe in reply to: Bruce Vander Werf: "[PHP-DB] Executing Queries from a File Using PHP"
- Next in thread: Jeffrey_N_Dyke <email protected>: "RE: [PHP-DB] Executing Queries from a File Using PHP"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
all you have to do is put one query per line in the file, it may be hard to
read, but who cares.
and then it is as simple as.
$contents = file("sql.txt"); //file function reads file into array
while (list ($qry)) = each($contents)) {
mysql_query($qry);
}
Just a thought....
Jeff
"Bruce Vander
Werf" To: <php-db <email protected>>
<brucev <email protected> cc:
ink.com> Subject: RE: [PHP-DB] Executing Queries from a File Using PHP
06/13/2002
08:39 AM
Please respond
to brucev
Thanks. Since it would take me forever to write, and I don't know thing
well
enough to make sure I have all the possibilities covered, I was hoping
there
was some source code somewhere I can use.
--Bruce
-----Original Message-----
From: Jason Wong [mailto:phplist <email protected>]
Sent: Wednesday, June 12, 2002 11:34 PM
To: php-db <email protected>
Subject: Re: [PHP-DB] Executing Queries from a File Using PHP
On Thursday 13 June 2002 10:48, Bruce Vander Werf wrote:
> Is there a PHP routine anywhere to execute a series of MySQL queries in a
> text file?
>
> I know how to do this via the command line or by using PHPMyAdmin, but I
> need to do it in my own PHP script, and some of the queries span more
than
> one line.
There are no built-in functions to do so. You need to read in the file
yourself, parse it appropriately then send the queries to mysql.
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* Thank you for observing all safety precautions. */
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
- Next message: José Moreira: "[PHP-DB] how is it possible to read data from an excel workbook ?"
- Previous message: Bruce Vander Werf: "RE: [PHP-DB] Executing Queries from a File Using PHP"
- Maybe in reply to: Bruce Vander Werf: "[PHP-DB] Executing Queries from a File Using PHP"
- Next in thread: Jeffrey_N_Dyke <email protected>: "RE: [PHP-DB] Executing Queries from a File Using PHP"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

