How to run .sql files using php

How to run .sql files using php

am 13.07.2005 17:38:33 von Guntha Aravind babu

--0-826501297-1121269113=:29501
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Hi ,

i have a set of queries which i have placed them in one .sql file.i want to run this file using php's mssql and oracle(oci) functions.
any idea pls.

thanks.
babu



---------------------------------
How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos. Get Yahoo! Photos
--0-826501297-1121269113=:29501--

RE: How to run .sql files using php

am 13.07.2005 17:53:53 von cshaw

Can you use mysqli_multi_query for mysql in php5?

hth

-----Original Message-----
From: babu [mailto:garavindbabu@yahoo.co.uk]
Sent: 13 July 2005 16:39
To: php-general@lists.php.net
Subject: [PHP] How to run .sql files using php=0D


Hi ,

i have a set of queries which i have placed them in one .sql file.i want to
run this file using php's mssql and oracle(oci) functions.
any idea pls.
=0D
thanks.
babu


=0D
---------------------------------
How much free photo storage do you get? Store your holiday snaps for FREE
with Yahoo! Photos. Get Yahoo! Photos


************************

This message has been delivered to the Internet by the Revenue Internet=
e-mail service

*************************

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: How to run .sql files using php

am 13.07.2005 18:05:22 von glumtail

------=_Part_795_9312719.1121270722741
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

I think it's better to split the SQL into pieces
line 1: create table ....
line 2: insert into .....
$sql =3D 'create table....'
$sql =3D 'insert into ...'

2005/7/13, Shaw, Chris - Accenture :=20
>=20
>=20
> Can you use mysqli_multi_query for mysql in php5?
>=20
> hth
>=20
> -----Original Message-----
> From: babu [mailto:garavindbabu@yahoo.co.uk]
> Sent: 13 July 2005 16:39
> To: php-general@lists.php.net
> Subject: [PHP] How to run .sql files using php
>=20
>=20
> Hi ,
>=20
> i have a set of queries which i have placed them in one .sql file.i want=
=20
> to
> run this file using php's mssql and oracle(oci) functions.
> any idea pls.
>=20
> thanks.
> babu
>=20
>=20
>=20
> ---------------------------------
> How much free photo storage do you get? Store your holiday snaps for FREE
> with Yahoo! Photos. Get Yahoo! Photos
>=20
>=20
> ************************
>=20
> This message has been delivered to the Internet by the Revenue Internet=
=20
> e-mail service
>=20
> *************************
>=20
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>=20
>

------=_Part_795_9312719.1121270722741--

Re: How to run .sql files using php

am 14.07.2005 12:06:56 von Raffael Wannenmacher

or execute a shell command

$ret = `mysql -u[user] -p[password] -h[host] [db_name] < file.sql`;

glumtail wrote:
> I think it's better to split the SQL into pieces
> line 1: create table ....
> line 2: insert into .....
> $sql = 'create table....'
> $sql = 'insert into ...'
>
> 2005/7/13, Shaw, Chris - Accenture :
>
>>
>>Can you use mysqli_multi_query for mysql in php5?
>>
>>hth
>>
>>-----Original Message-----
>>From: babu [mailto:garavindbabu@yahoo.co.uk]
>>Sent: 13 July 2005 16:39
>>To: php-general@lists.php.net
>>Subject: [PHP] How to run .sql files using php
>>
>>
>>Hi ,
>>
>>i have a set of queries which i have placed them in one .sql file.i want
>>to
>>run this file using php's mssql and oracle(oci) functions.
>>any idea pls.
>>
>>thanks.
>>babu
>>
>>
>>
>>---------------------------------
>>How much free photo storage do you get? Store your holiday snaps for FREE
>>with Yahoo! Photos. Get Yahoo! Photos
>>
>>
>>************************
>>
>>This message has been delivered to the Internet by the Revenue Internet
>>e-mail service
>>
>>*************************
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: How to run .sql files using php

am 14.07.2005 14:31:34 von Rory Browne

phpmyadmin

On 7/13/05, glumtail wrote:
> I think it's better to split the SQL into pieces
> line 1: create table ....
> line 2: insert into .....
> $sql =3D 'create table....'
> $sql =3D 'insert into ...'
>=20
> 2005/7/13, Shaw, Chris - Accenture :
> >
> >
> > Can you use mysqli_multi_query for mysql in php5?
> >
> > hth
> >
> > -----Original Message-----
> > From: babu [mailto:garavindbabu@yahoo.co.uk]
> > Sent: 13 July 2005 16:39
> > To: php-general@lists.php.net
> > Subject: [PHP] How to run .sql files using php
> >
> >
> > Hi ,
> >
> > i have a set of queries which i have placed them in one .sql file.i wan=
t
> > to
> > run this file using php's mssql and oracle(oci) functions.
> > any idea pls.
> >
> > thanks.
> > babu
> >
> >
> >
> > ---------------------------------
> > How much free photo storage do you get? Store your holiday snaps for FR=
EE
> > with Yahoo! Photos. Get Yahoo! Photos
> >
> >
> > ************************
> >
> > This message has been delivered to the Internet by the Revenue Internet
> > e-mail service
> >
> > *************************
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>=20
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: How to run .sql files using php

am 14.07.2005 14:55:03 von Ahmed Saad

hi babu

On 7/13/05, babu wrote:=20
> i have a set of queries which i have placed them in one .sql file.i want =
to run this file using php's mssql and oracle(oci) functions.

you need a database abstraction layer to help you with that (adodb for exam=
ple)

function fireSQL( $driver )
{

// establish the connection to the database using the specified driver

// read SQL from the file (probably tokenizing it into sql statements)

// feed the sql into the connection

}

-ahmed

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: How to run .sql files using php

am 16.07.2005 01:23:13 von glumtail

------=_Part_2297_8085112.1121469793575
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Ahmed:
It's real perfect!

B/R
2005/7/14, Ahmed Saad :=20
>=20
> hi babu
>=20
> On 7/13/05, babu wrote:
> > i have a set of queries which i have placed them in one .sql file.i wan=
t=20
> to run this file using php's mssql and oracle(oci) functions.
>=20
> you need a database abstraction layer to help you with that (adodb for=20
> example)
>=20
> function fireSQL( $driver )
> {
>=20
> // establish the connection to the database using the specified driver
>=20
> // read SQL from the file (probably tokenizing it into sql statements)
>=20
> // feed the sql into the connection
>=20
> }
>=20
> -ahmed
>=20
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>=20
>

------=_Part_2297_8085112.1121469793575--