Re: PHP: mysql_query()
| From: | Ben-Nes Michael | Date: | Tue, 14 Aug 2001 10:48:35 +0000 |
| Subject: | Re: PHP: mysql_query() | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-62610@lists.php.net to get a copy of this message | ||
For that MySQL team designed the Mysql client to get input from file and
execute it.
do
system ( "mysql < sql.fie");
or
mysql < sql.fie;
dont forget to use -D and -p if User is required.
----- Original Message -----
From: "lallous" <elias_bachaalany@yahoo.com>
To: <php-general@lists.php.net>
Sent: Tuesday, August 14, 2001 1:29 PM
Subject: Re: [PHP] PHP: mysql_query()
> No actually I have a .SQL file that is a complete dump of my database.
> All i want to do is the execute with mysql_query() the whole .SQL which
will
> create databases and tables and fillin fields!
>
> "Ben-Nes Michael" <admin@canaan.co.il> wrote in message
> news:004701c124a0$e690c860$aa5796d4@canaan.co.il...
> > You cant do this.
> >
> > Its even recommended to drop the `;' from the end of the sql command.
> >
> > You can go around using array to store the sql statements and use
foreach
> to
> > run mysql_query with thee sql statement.
> >
> > But I don't think its right way to do thing !
> >
> > If you intention was to do update one after other then you should use
> locks
> > or use Postgres :)
> >
> > --------------------------
> > Canaan Surfing Ltd.
> > Internet Service Providers
> > Ben-Nes Michael - Manager
> > Tel: 972-4-6991122
> > http://sites.canaan.co.il
> > --------------------------
> >
> > ----- Original Message -----
> > From: "lallous" <elias_bachaalany@yahoo.com>
> > To: <php-general@lists.php.net>
> > Sent: Tuesday, August 14, 2001 12:59 PM
> > Subject: [PHP] PHP: mysql_query()
> >
> >
> > > Actually the mysql_query() seems to accept only one statement at a
time.
> > >
> > > Any work around so i can do query suchs:
> > >
> > > mysql_query("
> > > SELECT 1+1;
> > > SHOW DATABASES;
> > > USE database1;
> > > SELECT * FROM table1;
> > > ");
> > >
> > > Just multiple commands seperated with ';' ? (as if using the Mysql
> command
> > > prompt)
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > > For additional commands, e-mail: php-general-help@lists.php.net
> > > To contact the list administrators, e-mail:
php-list-admin@lists.php.net
> > >
> > >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>