pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
set_time_limit -VS- database queries
4+ messages / 3 participants
[nested] [flat]

* set_time_limit -VS- database queries
@ 2002-04-09 11:44  Areski Belaid <areski5@hotmail.com>
  1 sibling, 0 replies; 4+ messages in thread

From: Areski Belaid @ 2002-04-09 11:44 UTC (permalink / raw)
  To: pgsql-php

Hi everybody,


Ok, explain:
I do a lot of database queries with php...
to import a lot of field in the database...


In the first time, i put the set_time_limit(0)
But the execution of the script such as system calls using system(), 
the sleep() function, database queries, etc. is not included when 
determining the maximum time that the script has been running. 

So, of course, Ii can't put my script on background...
but I want known how many field has been inserted (hai)...


Helpsssssss

Areski



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: set_time_limit -VS- database queries
@ 2002-04-09 23:33  Chris <csmith@squiz.net>
  1 sibling, 1 reply; 4+ messages in thread

From: Chris @ 2002-04-09 23:33 UTC (permalink / raw)
  To: Areski Belaid <areski5@hotmail.com>; pgsql-php

Hi,

>I do a lot of database queries with php...
>to import a lot of field in the database...
>
>In the first time, i put the set_time_limit(0)
>But the execution of the script such as system calls using system(),
>the sleep() function, database queries, etc. is not included when
>determining the maximum time that the script has been running.
>
>So, of course, Ii can't put my script on background...

What do you mean put it in the background ?

>but I want known how many field has been inserted (hai)...

It depends on how you're inserting (or updating) them.

If you're using some sort of loop to do it, you can add another variable in 
to automatically increment when you do an update or insert.


-----------------
      Chris Smith
http://www.squiz.net/




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: set_time_limit -VS- database queries
@ 2002-04-10 08:57  Areski Belaid <areski5@hotmail.com>
  parent: Chris <csmith@squiz.net>
  0 siblings, 1 reply; 4+ messages in thread

From: Areski Belaid @ 2002-04-10 08:57 UTC (permalink / raw)
  To: pgsql-php; Chris <csmith@squiz.net>

> Hi,
>
> >I do a lot of database queries with php...
> >to import a lot of field in the database...
> >
> >In the first time, i put the set_time_limit(0)
> >But the execution of the script such as system calls using system(),
> >the sleep() function, database queries, etc. is not included when
> >determining the maximum time that the script has been running.
> >
> >So, of course, Ii can't put my script on background...
>
> What do you mean put it in the background ?
Launch a script with exec() or system()...

>
> >but I want known how many field has been inserted (hai)...
>
> It depends on how you're inserting (or updating) them.
>
> If you're using some sort of loop to do it, you can add another variable
in
> to automatically increment when you do an update or insert.

I have a double key on a table and some insert can be failed and I want
known how many
is really inserted... I can always know that with the last id (oid)...

Thus,I just want know if there are a way to execute a script without timeout
when I do
some database query...



             Thanks a lot, Areski (qui rit)
             -> http://www.areski.be.tf











^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: set_time_limit -VS- database queries
@ 2002-04-10 12:38  Papp, Gyozo <pgerzson@freestart.hu>
  parent: Areski Belaid <areski5@hotmail.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Papp, Gyozo @ 2002-04-10 12:38 UTC (permalink / raw)
  To: Areski Belaid <areski5@hotmail.com>; +Cc: pgsql-php

Hi,
----- Original Message ----- 
From: "Areski Belaid" <areski5@hotmail.com>
To: <pgsql-php@postgresql.org>; "Chris" <csmith@squiz.net>
Sent: Wednesday, April 10, 2002 10:57 AM
Subject: Re: [PHP] set_time_limit -VS- database queries


| > Hi,
| >
| > >I do a lot of database queries with php...
| > >to import a lot of field in the database...

If you don't want to output any result from these queries, you may 
consider putting them in a shutdown function which will be called
after all output is sent to the browser, in other words the request
has been completed, the connection has been closed.
Shutdown functions generally are used to close special, "hand-made"
connections, to empty queues, etc, but it is also possible to make
any database query. You're just unable to send any type of output
to the browser, but note that error_reporting() does work. 

You may specify several shutdown functions with register_shutdown_function() 
http://www.php.net/manual/en/function.register-shutdown-function.php

| > >
| > >In the first time, i put the set_time_limit(0)
| > >But the execution of the script such as system calls using system(),
| > >the sleep() function, database queries, etc. is not included when
| > >determining the maximum time that the script has been running.
| > >
| > >So, of course, Ii can't put my script on background...
| >
| > What do you mean put it in the background ?
| Launch a script with exec() or system()...
| 
| >
| > >but I want known how many field has been inserted (hai)...
| >
| > It depends on how you're inserting (or updating) them.
| >
| > If you're using some sort of loop to do it, you can add another variable
| in
| > to automatically increment when you do an update or insert.
| 
| I have a double key on a table and some insert can be failed and I want
| known how many
| is really inserted... I can always know that with the last id (oid)...
| 
| Thus,I just want know if there are a way to execute a script without timeout
| when I do
| some database query...
| 
| 
| 
|              Thanks a lot, Areski (qui rit)
|              -> http://www.areski.be.tf
| 
| 
| 
| 
| 
| 
| 
| 
| 
| ---------------------------(end of broadcast)---------------------------
| TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org




^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2002-04-10 12:38 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-04-09 11:44 ` Areski Belaid <areski5@hotmail.com>
2002-04-09 23:33 ` Chris <csmith@squiz.net>
2002-04-10 08:57   ` Areski Belaid <areski5@hotmail.com>
2002-04-10 12:38     ` Papp, Gyozo <pgerzson@freestart.hu>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox