php-windows Digest 27 May 2004 13:39:55 -0000 Issue 2264

Topics (messages 23851 through 23864):

Re: Hello and first question
        23851 by: Justin Patrin
        23852 by: Ross Honniball

Transfering database
        23853 by: Sudeep Zamudra
        23854 by: Jeroen Serpieters
        23855 by: Svensson, B.A.T. (HKG)
        23856 by: George Pitcher
        23857 by: Svensson, B.A.T. (HKG)
        23859 by: Sudeep Zamudra
        23860 by: Svensson, B.A.T. (HKG)
        23861 by: Sudeep Zamudra
        23862 by: Svensson, B.A.T. (HKG)
        23863 by: Angelo Zanetti

Re: Output Control
        23858 by: Svensson, B.A.T. (HKG)
        23864 by: Luis Moreira

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message --- Chris Patrick Carias Stas wrote:
I have problems running php scripts under w2k. for example, a form to send a mail. I 
has 3 fields, name, email and msg. The actions goes through POST to a file send.php. 
In send.php i try to use the variables $name, $email and $msg, but it says they are 
not declared. The same script works fine under linux. I tried installing apache with 
php instead of IIS but the same thing happens. I installed the cgi and de module 
version of php, but the same error occurs. Any sugestions?

Chris

The register_globals php.ini setting is set to 0 on your windows box. This is, however, a *good* thing. You should generally use the superglobal arrays to access these variables so that you know exactly where your variables are coming from.


$_POST
$_GET
$_REQUEST
$_COOKIE
$_FILES

--
paperCrane <Justin Patrin>

--- End Message ---
--- Begin Message ---
My preference is to use $_REQUEST over $_POST and $_GET.

Also, if you are really keen on short variable names, you can use the function:

  extract($_REQUEST);

and it will create short variable names. You might want to look this up in the manual for more details (to do with name collisions etc.)

Ross.

At 10:01 AM 27/05/2004, you wrote:
Chris Patrick Carias Stas wrote:
I have problems running php scripts under w2k. for example, a form to send a mail. I has 3 fields, name, email and msg. The actions goes through POST to a file send.php. In send.php i try to use the variables $name, $email and $msg, but it says they are not declared. The same script works fine under linux. I tried installing apache with php instead of IIS but the same thing happens. I installed the cgi and de module version of php, but the same error occurs. Any sugestions?
Chris

The register_globals php.ini setting is set to 0 on your windows box. This is, however, a *good* thing. You should generally use the superglobal arrays to access these variables so that you know exactly where your variables are coming from.


$_POST
$_GET
$_REQUEST
$_COOKIE
$_FILES

--
paperCrane <Justin Patrin>

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

. . Ross Honniball. JCU Bookshop Cairns, Qld, Australia. .

--- End Message ---
--- Begin Message ---
Hi everyone,
 
I have dumped my entire database into files with extension '.sql' (separate file for 
each table). Now please tell me any function or statements if any to tranfer the 
contents of the file(i.e table structure and table contents) into a new database which 
is on another database server. I guess there is a statement for this. Help please.
 
Sudeep 

                
---------------------------------
Do you Yahoo!?
Friends.  Fun. Try the all-new Yahoo! Messenger

--- End Message ---
--- Begin Message ---
On Wed, 26 May 2004, Sudeep Zamudra wrote:

>
> I have dumped my entire database into files with extension '.sql' (separate file for 
> each table). Now please tell me any function or statements if any to tranfer the 
> contents of the file(i.e table structure and table contents) into a new database 
> which is on another database server. I guess there is a statement for this. Help 
> please.
>

mysql -u username -p database < C:\path\to\your\dump\file.sql

-- 
Jeroen

There are only two kinds of programming languages: those people always bitch about and 
those nobody uses.
        -- Bjarne Stroustrup

--- End Message ---
--- Begin Message ---
Well,

if you could be so kind to 1) tell what kind of RDBMS you want to
load the data in, and 2) in wich format the data is in the file (a file
extension is not sufficient to tell this), then actually somebody might be
able to give you a proper answer as well. 

If the answer on 1) is MS SQL, and the answer on 2) tabdelimited, then my
answer is, assuming the tables are already present in the target RDBMS, use
bcp.exe.


-----Original Message-----
From: Sudeep Zamudra
To: php mailinglist
Sent: 27-5-2004 8:13
Subject: [PHP-WIN] Transfering database

Hi everyone,
 
I have dumped my entire database into files with extension '.sql'
(separate file for each table). Now please tell me any function or
statements if any to tranfer the contents of the file(i.e table
structure and table contents) into a new database which is on another
database server. I guess there is a statement for this. Help please.
 
Sudeep 

                
---------------------------------
Do you Yahoo!?
Friends.  Fun. Try the all-new Yahoo! Messenger

--- End Message ---
--- Begin Message ---
Sudeep,

This is a php list, you are asking a MySQL question with no relevance to
php.

Check the MySQL manual for Load Infile commands. I have to admit I can never
get them to work on my versions of MySQL and have tended to use other
methods to load tables.

As I said before, with MySQLFront, you can paste the content of your .sql
file into the SQL query panel and run it. Your table will be built. I do
this all the time, regardless of local or remote MySQL server. Just create
your database first, open it then do the query.

George in Oxford

> -----Original Message-----
> From: Sudeep Zamudra [mailto:[EMAIL PROTECTED]
> Sent: 27 May 2004 7:14 am
> To: php mailinglist
> Subject: [PHP-WIN] Transfering database
>
>
> Hi everyone,
>
> I have dumped my entire database into files with extension '.sql'
> (separate file for each table). Now please tell me any function
> or statements if any to tranfer the contents of the file(i.e
> table structure and table contents) into a new database which is
> on another database server. I guess there is a statement for
> this. Help please.
>
> Sudeep
>
>
> ---------------------------------
> Do you Yahoo!?
> Friends.  Fun. Try the all-new Yahoo! Messenger

--- End Message ---
--- Begin Message ---
 

-----Original Message-----
From: George Pitcher

Sudeep,

> This is a php list, you are asking a MySQL question with
> no relevance to php.

The guy never claimed it was an MySQL database, that's only
what you are assuming. ;) :) But I do agree with your point. ;)

--- End Message ---
--- Begin Message ---
Thanx for your suggestions. But i am looking for a php script by which i can do this 
not from the mysql shell command line. If any has it . Please suggest it to me.
 
Thanx

Jeroen Serpieters <[EMAIL PROTECTED]> wrote:
On Wed, 26 May 2004, Sudeep Zamudra wrote:

>
> I have dumped my entire database into files with extension '.sql' (separate file for 
> each table). Now please tell me any function or statements if any to tranfer the 
> contents of the file(i.e table structure and table contents) into a new database 
> which is on another database server. I guess there is a statement for this. Help 
> please.
>

mysql -u username -p database < C:\path\to\your\dump\file.sql

-- 
Jeroen

There are only two kinds of programming languages: those people always bitch about and 
those nobody uses.
-- Bjarne Stroustrup

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

                
---------------------------------
Do you Yahoo!?
Friends.  Fun. Try the all-new Yahoo! Messenger

--- End Message ---
--- Begin Message ---
RTFM:

popen("mysql -u username -p database < C:\path\to\your\dump\file.sql");

shell_exec("mysql -u username -p database < C:\path\to\your\dump\file.sql");

system("mysql -u username -p database < C:\path\to\your\dump\file.sql");


etc, etc, etc...

-----Original Message-----
From: Sudeep Zamudra
To: Jeroen Serpieters
Cc: [EMAIL PROTECTED]
Sent: 27-5-2004 9:13
Subject: Re: [PHP-WIN] Transfering database

Thanx for your suggestions. But i am looking for a php script by which i
can do this not from the mysql shell command line. If any has it .
Please suggest it to me.
 
Thanx

Jeroen Serpieters <[EMAIL PROTECTED]> wrote:
On Wed, 26 May 2004, Sudeep Zamudra wrote:

>
> I have dumped my entire database into files with extension '.sql'
(separate file for each table). Now please tell me any function or
statements if any to tranfer the contents of the file(i.e table
structure and table contents) into a new database which is on another
database server. I guess there is a statement for this. Help please.
>


-- 
Jeroen

There are only two kinds of programming languages: those people always
bitch about and those nobody uses.
-- Bjarne Stroustrup

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

                
---------------------------------
Do you Yahoo!?
Friends.  Fun. Try the all-new Yahoo! Messenger

--- End Message ---
--- Begin Message ---
hi,
 
Please make it clear. My server is unix. I have no knowledge of shell commands. This 
is what i want. Ex:- My username is root and database name is xyz and the .sql file is 
in my server www/html/test/. What should i do

"Svensson, B.A.T. (HKG)" <[EMAIL PROTECTED]> wrote:
RTFM:

popen("mysql -u username -p database < C:\path\to\your\dump\file.sql");

shell_exec("mysql -u username -p database < C:\path\to\your\dump\file.sql");

system("mysql -u username -p database < C:\path\to\your\dump\file.sql");


etc, etc, etc...

-----Original Message-----
From: Sudeep Zamudra
To: Jeroen Serpieters
Cc: [EMAIL PROTECTED]
Sent: 27-5-2004 9:13
Subject: Re: [PHP-WIN] Transfering database

Thanx for your suggestions. But i am looking for a php script by which i
can do this not from the mysql shell command line. If any has it .
Please suggest it to me.

Thanx

Jeroen Serpieters wrote:
On Wed, 26 May 2004, Sudeep Zamudra wrote:

>
> I have dumped my entire database into files with extension '.sql'
(separate file for each table). Now please tell me any function or
statements if any to tranfer the contents of the file(i.e table
structure and table contents) into a new database which is on another
database server. I guess there is a statement for this. Help please.
>


-- 
Jeroen

There are only two kinds of programming languages: those people always
bitch about and those nobody uses.
-- Bjarne Stroustrup

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


---------------------------------
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger

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

                
---------------------------------
Do you Yahoo!?
Friends.  Fun. Try the all-new Yahoo! Messenger

--- End Message ---
--- Begin Message ---
In all friendly manner:

Take my advice - according to your request, you only want to load this data,
so don't do this with php, do it from a command line. It is /not/ needed to
walk over the river to get to the water.

But if you don't know how to handle a command shell in unix stay away from
it! Especially if you run as root!!! Please do contact your local admin and
he will help you out - or at least somebody with some knowledge of unix
shells.

Secondly, I don't see this as my mission to be an educator about these basic
things, I suggest you get some help from professional support or something
similar instead of playing around with a system that you may damage beyond
all repair.

And by the way, I actually gave you three php examples below.


-----Original Message-----
From: Sudeep Zamudra
To: Svensson, B.A.T. (HKG)
Cc: php mailinglist
Sent: 27-5-2004 10:03
Subject: RE: [PHP-WIN] Transfering database

hi,
 
Please make it clear. My server is unix. I have no knowledge of shell
commands. This is what i want. Ex:- My username is root and database
name is xyz and the .sql file is in my server www/html/test/. What
should i do

"Svensson, B.A.T. (HKG)" <[EMAIL PROTECTED]> wrote:

RTFM:

popen("mysql -u username -p database < C:\path\to\your\dump\file.sql");

shell_exec("mysql -u username -p database <
C:\path\to\your\dump\file.sql");

system("mysql -u username -p database < C:\path\to\your\dump\file.sql");


etc, etc, etc...

-----Original Message-----
From: Sudeep Zamudra
To: Jeroen Serpieters
Cc: [EMAIL PROTECTED]
Sent: 27-5-2004 9:13
Subject: Re: [PHP-WIN] Transfering database

Thanx for your suggestions. But i am looking for a php script by which i
can do this not from the mysql shell command line. If any has it .
Please suggest it to me.

Thanx

Jeroen Serpieters wrote:
On Wed, 26 May 2004, Sudeep Zamudra wrote:

>
> I have dumped my entire database into files with extension '.sql'
(separate file for each table). Now please tell me any function or
statements if any to tranfer the contents of the file(i.e table
structure and table contents) into a new database which is on another
database server. I guess there is a statement for this. Help please.
>


-- 
Jeroen

There are only two kinds of programming languages: those people always
bitch about and those nobody uses.
-- Bjarne Stroustrup

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


---------------------------------
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger

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



  _____  

Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger
<http://messenger.yahoo.com/> 

--- End Message ---
--- Begin Message ---
why dont you do some research before you just expect other people to your
work for you. YOu seem to make no attempt to find out anything about what
you've asked. Svensson gave you the the commands for what you just asked.

it's getting ridiculous, anyone second that?

Angelo

-----Original Message-----
From: Sudeep Zamudra [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 27, 2004 10:04 AM
To: Svensson, B.A.T. (HKG)
Cc: php mailinglist
Subject: RE: [PHP-WIN] Transfering database


hi,

Please make it clear. My server is unix. I have no knowledge of shell
commands. This is what i want. Ex:- My username is root and database name is
xyz and the .sql file is in my server www/html/test/. What should i do

"Svensson, B.A.T. (HKG)" <[EMAIL PROTECTED]> wrote:
RTFM:

popen("mysql -u username -p database < C:\path\to\your\dump\file.sql");

shell_exec("mysql -u username -p database < C:\path\to\your\dump\file.sql");

system("mysql -u username -p database < C:\path\to\your\dump\file.sql");


etc, etc, etc...

-----Original Message-----
From: Sudeep Zamudra
To: Jeroen Serpieters
Cc: [EMAIL PROTECTED]
Sent: 27-5-2004 9:13
Subject: Re: [PHP-WIN] Transfering database

Thanx for your suggestions. But i am looking for a php script by which i
can do this not from the mysql shell command line. If any has it .
Please suggest it to me.

Thanx

Jeroen Serpieters wrote:
On Wed, 26 May 2004, Sudeep Zamudra wrote:

>
> I have dumped my entire database into files with extension '.sql'
(separate file for each table). Now please tell me any function or
statements if any to tranfer the contents of the file(i.e table
structure and table contents) into a new database which is on another
database server. I guess there is a statement for this. Help please.
>


--
Jeroen

There are only two kinds of programming languages: those people always
bitch about and those nobody uses.
-- Bjarne Stroustrup

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


---------------------------------
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger

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


---------------------------------
Do you Yahoo!?
Friends.  Fun. Try the all-new Yahoo! Messenger

--------------------------------------------------------------------
Disclaimer 
This e-mail transmission contains confidential information,
which is the property of the sender.
The information in this e-mail or attachments thereto is 
intended for the attention and use only of the addressee. 
Should you have received this e-mail in error, please delete 
and destroy it and any attachments thereto immediately. 
Under no circumstances will the Cape Technikon or the sender 
of this e-mail be liable to any party for any direct, indirect, 
special or other consequential damages for any use of this e-mail.
For the detailed e-mail disclaimer please refer to 
http://www.ctech.ac.za/polic or call +27 (0)21 460 3911

--- End Message ---
--- Begin Message ---
Are you trying to say that flush() does not work properly for you, i.e you
don't see the numbers comming one by one with a seconds delay, but get all
at once?

-----Original Message-----
From: William CANDILLON
To: [EMAIL PROTECTED]
Sent: 26-5-2004 17:34
Subject: RE: [PHP-WIN] Output Control

I just want to see the numbers before 10 seconds in my browser like in
shell mod.

-----Message d'origine-----
De�: Luis Moreira [mailto:[EMAIL PROTECTED] 
Envoy�: mercredi 26 mai 2004 17:21
��: William CANDILLON; [EMAIL PROTECTED]
Objet�: Re: [PHP-WIN] Output Control

William CANDILLON wrote:

>I want to execute my script in a browser as with the shell mode.
>
>Example:
>
><?
>
>static $i = 0;
>while ($i < 10) {
>++$i;
>echo "$i\n\n";
>sleep(1);
>}
>
>?>
>
>I've tried this but it's doesn't work :
>
><?
>
>static $i = 0;
>while ($i < 10) {
>++$i;
>echo "$i\n\n";
>flush();
>sleep(1);
>}
>
>?>
>
>  
>
What exactly is your problem ?
I tried this and it simply echoes the numbers 1 to 10 in a single line.
If you want to echo them in separate lines, then you need

echo "$i<br>";


Luis

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

--- End Message ---
--- Begin Message ---
Svensson, B.A.T. (HKG) wrote:

Are you trying to say that flush() does not work properly for you, i.e you
don't see the numbers comming one by one with a seconds delay, but get all
at once?



William,

If you go to www.php.net and look for "flush" you will see that the problem you experience is related to either the web server or the web client.
I think that this is not a PHP issue.
It is true that (I tried this with my own Apache server) that the numbers come out all at the end, and not with a second's interval.
I will try and search a bit further.


Luis
--- End Message ---

Reply via email to