[PHP] PHP: mysql_query()

2001-08-14 Thread lallous

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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP: mysql_query()

2001-08-14 Thread Ben-Nes Michael

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 [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
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: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP: mysql_query()

2001-08-14 Thread lallous

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 [EMAIL PROTECTED] wrote in message
004701c124a0$e690c860$[EMAIL PROTECTED]">news:004701c124a0$e690c860$[EMAIL PROTECTED]...
 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 [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 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: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP: mysql_query()

2001-08-14 Thread Ben-Nes Michael

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 [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
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 [EMAIL PROTECTED] wrote in message
 004701c124a0$e690c860$[EMAIL PROTECTED]">news:004701c124a0$e690c860$[EMAIL PROTECTED]...
  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 [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  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: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   To contact the list administrators, e-mail:
[EMAIL PROTECTED]
  
  
 



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP: mysql_query()

2001-08-14 Thread Alnisa Allgood

At 2:21 PM +0200 8/14/01, lallous wrote:
I can't execute MySql via system() I have no rights!


Generally ISPs either give you shell rights or access to PHPMyAdmin, 
if they give access to a MySQL database. Otherwise, you'd never be 
able to add tables, or modify data.  If PHPMyAdmin is installed, you 
can general locate it in the following manner: your_url/phpmyadmin

So http://www.my_crazy_domain.com/phpmyadmin

You'll need to enter your database username and password, but this 
will allow you to upload INSERT statements, perform routine MySQL 
tasks, as well as run SQL queries.

Otherwise you need to request shell access from your ISP. Some ISPs 
only provide it when asked.

Alnisa
-- 
   .
Alnisa  Allgood
Executive Director
Nonprofit Tech
(ph) 415.337.7412  (fx) 415.337.7927
(url)  http://www.nonprofit-techworld.org
(url)  http://www.nonprofit-tech.org
(url)  http://www.tech-library.org
   .
Nonprofit Tech E-Update
mailto:[EMAIL PROTECTED]
   .
applying technology to transform
   .

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP: mysql_query()

2001-08-14 Thread _lallous

Basically I have PHPMyAdmin...
If I am to paste the 33,000+ lines SQL query the PHPMyAdmin would take more
than 30secs to execute it which will make everything fail!
Anyway, I solved it. Check the recent post in the same thread about SQL2PHP
script.

Alnisa Allgood [EMAIL PROTECTED] wrote in message
news:p05100305b79ec2415b87@[63.202.15.82]...
 At 2:21 PM +0200 8/14/01, lallous wrote:
 I can't execute MySql via system() I have no rights!
 

 Generally ISPs either give you shell rights or access to PHPMyAdmin,
 if they give access to a MySQL database. Otherwise, you'd never be
 able to add tables, or modify data.  If PHPMyAdmin is installed, you
 can general locate it in the following manner: your_url/phpmyadmin

 So http://www.my_crazy_domain.com/phpmyadmin

 You'll need to enter your database username and password, but this
 will allow you to upload INSERT statements, perform routine MySQL
 tasks, as well as run SQL queries.

 Otherwise you need to request shell access from your ISP. Some ISPs
 only provide it when asked.

 Alnisa
 --
.
 Alnisa  Allgood
 Executive Director
 Nonprofit Tech
 (ph) 415.337.7412  (fx) 415.337.7927
 (url)  http://www.nonprofit-techworld.org
 (url)  http://www.nonprofit-tech.org
 (url)  http://www.tech-library.org
.
 Nonprofit Tech E-Update
 mailto:[EMAIL PROTECTED]
.
 applying technology to transform
.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP: mysql_query()

2001-08-14 Thread Alnisa Allgood

At 4:05 PM +0200 8/14/01, _lallous wrote:
Basically I have PHPMyAdmin...
If I am to paste the 33,000+ lines SQL query the PHPMyAdmin would take more
than 30secs to execute it which will make everything fail!
Anyway, I solved it. Check the recent post in the same thread about SQL2PHP
script.


You don't have to past, you just upload the file, as a SQL query, and 
select go. If the file still fails, just break it in two. 
fileinsert1.sql, fileinsert2.sql,  I've seen people insert over 
60,000 records this way no errors. I've personally never worked with 
more than 10,000 records at a time, but if time outs are the issue, 
then just break the file into smaller files.

Alnisa
-- 
   .
Alnisa  Allgood
Executive Director
Nonprofit Tech
(ph) 415.337.7412  (fx) 415.337.7927
(url)  http://www.nonprofit-techworld.org
(url)  http://www.nonprofit-tech.org
(url)  http://www.tech-library.org
   .
Nonprofit Tech E-Update
mailto:[EMAIL PROTECTED]
   .
applying technology to transform
   .

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP: mysql_query()

2001-08-14 Thread _lallous

I have PHPMyAdmin 2.21
I only see GO button, where can I upload my SQL file?

Alnisa Allgood [EMAIL PROTECTED] wrote in message
news:p05100309b79edae8263f@[63.202.15.82]...
 At 4:05 PM +0200 8/14/01, _lallous wrote:
 Basically I have PHPMyAdmin...
 If I am to paste the 33,000+ lines SQL query the PHPMyAdmin would take
more
 than 30secs to execute it which will make everything fail!
 Anyway, I solved it. Check the recent post in the same thread about
SQL2PHP
 script.
 

 You don't have to past, you just upload the file, as a SQL query, and
 select go. If the file still fails, just break it in two.
 fileinsert1.sql, fileinsert2.sql,  I've seen people insert over
 60,000 records this way no errors. I've personally never worked with
 more than 10,000 records at a time, but if time outs are the issue,
 then just break the file into smaller files.

 Alnisa
 --
.
 Alnisa  Allgood
 Executive Director
 Nonprofit Tech
 (ph) 415.337.7412  (fx) 415.337.7927
 (url)  http://www.nonprofit-techworld.org
 (url)  http://www.nonprofit-tech.org
 (url)  http://www.tech-library.org
.
 Nonprofit Tech E-Update
 mailto:[EMAIL PROTECTED]
.
 applying technology to transform
.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP: mysql_query()

2001-08-14 Thread Alnisa Allgood

At 5:25 PM +0200 8/14/01, _lallous wrote:
I have PHPMyAdmin 2.21
I only see GO button, where can I upload my SQL file?


Well my ISP uses PHPMyAdmin 2.10, which I can't imagine would be that 
different from 2.21. Basically, if I load, and click on the database 
name in the left top corner:

Home
+ databasename

To the right, the window display will list all my databases, action 
options and number of records. Under that area is a text box where I 
can enter SELECT statements, or upload queries as text files. The 
screen generally looks like:

PHPMyAdmin Window (Right Pane Only)

table   Action  Records
.
tb1 Browse  Select  Insert  Properties   Drop   Empty150
tb2 Browse  Select  Insert  Properties   Drop   Empty2456

.
Run SQL query/queries on databasedatabasename [Documentation]:

.
:   :
:   :
:   text box:
:   :
.
or Location of the textfile:
.
:   file upload :  Browse
.
Go
...

The Go button will perform either information from the text box, or 
an indicated file.

I believe it's a typical install of PHPMyAdmin, but I could be wrong.

Alnisa
-- 
   .
Alnisa  Allgood
Executive Director
Nonprofit Tech
(ph) 415.337.7412  (fx) 415.337.7927
(url)  http://www.nonprofit-techworld.org
(url)  http://www.nonprofit-tech.org
(url)  http://www.tech-library.org
   .
Nonprofit Tech E-Update
mailto:[EMAIL PROTECTED]
   .
applying technology to transform
   .

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]