473,396 Members | 1,965 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

how php parses code

Hi,

I'm wondering when php executes the code.
I have a little script which takes around 10 seconds execution time.
In those 10 seconds the script does a lot of mysql_queries and changes
some data.
If the script stops after 5 seconds and restarts it will mess up my
data.

But it seems if php goes through the code and executes all the
mysql-queries after it is finished (after the 10 seconds).

So my question is, when does php executes the mysql-queries?

Jan 25 '07 #1
5 1527
On Jan 25, 11:04 am, "Cord-Heinrich Pahlmann" <S...@Heineken2000.de>
wrote:
Hi,

I'm wondering when php executes the code.
I have a little script which takes around 10 seconds execution time.
In those 10 seconds the script does a lot of mysql_queries and changes
some data.
If the script stops after 5 seconds and restarts it will mess up my
data.

But it seems if php goes through the code and executes all the
mysql-queries after it is finished (after the 10 seconds).

So my question is, when does php executes the mysql-queries?
Once the client sends the request, the PHP is parsed by a running php
process (i.e. cgi or apache module). PHP's database wrappers
communicate with the database and handle the data.

It sounds like there could be a problem with your configuration or
code. This is probably the wrong avenue to explore to find a solution
to your problem.

--
Curtis

Jan 26 '07 #2
Rik
On Fri, 26 Jan 2007 12:54:01 +0100, Curtis <dy****@gmail.comwrote:
On Jan 25, 11:04 am, "Cord-Heinrich Pahlmann" <S...@Heineken2000.de>
wrote:
>I have a little script which takes around 10 seconds execution time.
In those 10 seconds the script does a lot of mysql_queries and changes
some data.
If the script stops after 5 seconds and restarts it will mess up my
data.
We've got a setting to ignore an abort:
http://www.php.net/ignore-user-abort
>But it seems if php goes through the code and executes all the
mysql-queries after it is finished (after the 10 seconds).

So my question is, when does php executes the mysql-queries?

Once the client sends the request, the PHP is parsed by a running php
process (i.e. cgi or apache module). PHP's database wrappers
communicate with the database and handle the data.

It sounds like there could be a problem with your configuration or
code. This is probably the wrong avenue to explore to find a solution
to your problem.
Yup, unless you're using some weird code I'd say PHP executes queries on
executing. mysql_unbuffered_query can lead to some funky results sometimes
though.
--
Rik Wasmus
Jan 26 '07 #3


On 26 Jan., 13:04, Rik <luiheidsgoe...@hotmail.comwrote:
On Fri, 26 Jan 2007 12:54:01 +0100, Curtis <dye...@gmail.comwrote:
On Jan 25, 11:04 am, "Cord-Heinrich Pahlmann" <S...@Heineken2000.de>
wrote:
I have a little script which takes around 10 seconds execution time.
In those 10 seconds the script does a lot of mysql_queries and changes
some data.
If the script stops after 5 seconds and restarts it will mess up my
data.We've got a setting to ignore an abort:http://www.php.net/ignore-user-abort
But it seems if php goes through the code and executes all the
mysql-queries after it is finished (after the 10 seconds).
So my question is, when does php executes the mysql-queries?
Once the client sends the request, the PHP is parsed by a running php
process (i.e. cgi or apache module). PHP's database wrappers
communicate with the database and handle the data.
It sounds like there could be a problem with your configuration or
code. This is probably the wrong avenue to explore to find a solution
to your problem.Yup, unless you're using some weird code I'd say PHP executes queries on
executing. mysql_unbuffered_query can lead to some funky results sometimes
though.
--
Rik Wasmus
Thank both of you for the answers. I'm was actually pretty sure, that
my code is OK. Those DB-Queries are pretty simple. I take some
blowfish-encrypted passwords from my DB decrypt them, encrypt them
with a newly generated key and then store them back into the DB.
I just thought that the de-/encryption takes so long. When I do this
with <10 passwords it is pretty fast. But when I do the same thing
with 30 it takes at least 10 seconds.
I will look through my code again and do some more testing. Maybe I
have some weird loop hanging around somewhere.

The ignore_user_abort function is really nice. I think I will have
good use for it in this and future projects. Thx.

Jan 28 '07 #4
On Jan 28, 2:41 pm, "Cord-Heinrich Pahlmann" <S...@Heineken2000.de>
wrote:
On 26 Jan., 13:04, Rik <luiheidsgoe...@hotmail.comwrote:
On Fri, 26 Jan 2007 12:54:01 +0100, Curtis <dye...@gmail.comwrote:
On Jan 25, 11:04 am, "Cord-Heinrich Pahlmann" <S...@Heineken2000.de>
wrote:
>I have a little script which takes around 10 seconds execution time.
>In those 10 seconds the script does a lot of mysql_queries and changes
>some data.
>If the script stops after 5 seconds and restarts it will mess up my
>data.We've got a setting to ignore an abort:http://www.php.net/ignore-user-abort
>But it seems if php goes through the code and executes all the
>mysql-queries after it is finished (after the 10 seconds).
>So my question is, when does php executes the mysql-queries?
Once the client sends the request, the PHP is parsed by a running php
process (i.e. cgi or apache module). PHP's database wrappers
communicate with the database and handle the data.
It sounds like there could be a problem with your configuration or
code. This is probably the wrong avenue to explore to find a solution
to your problem.Yup, unless you're using some weird code I'd say PHP executes queries on
executing. mysql_unbuffered_query can lead to some funky results sometimes
though.
--
Rik Wasmus

Thank both of you for the answers. I'm was actually pretty sure, that
my code is OK. Those DB-Queries are pretty simple. I take some
blowfish-encrypted passwords from my DB decrypt them, encrypt them
with a newly generated key and then store them back into the DB.
I just thought that the de-/encryption takes so long. When I do this
with <10 passwords it is pretty fast. But when I do the same thing
with 30 it takes at least 10 seconds.
I will look through my code again and do some more testing. Maybe I
have some weird loop hanging around somewhere.

The ignore_user_abort function is really nice. I think I will have
good use for it in this and future projects. Thx.
I'm glad we could narrow down the problem. I have the mcrypt lib
enabled for my php installation, but I have yet to test it, but it
seems like the encryption and decryption code is worth looking at. It
couldn't hurt, posting your code here.

--
Curtis

Jan 30 '07 #5
Hi.

I got the code from the following webpage: http://www.php-einfach.de/
sonstiges_generator_blowfish.php#ausgabe
It's German, though.
I hope u can use it.

Feb 1 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

51
by: Mudge | last post by:
Please, someone, tell me why OO in PHP is better than procedural.
3
by: Megiddo | last post by:
Is there an HTTP server that parses PHP that will run on the Axim x3i? I'd really like to know the answer to this question. I'm a big PHP programmer, and would love to be able to test my...
9
by: bigoxygen | last post by:
Hi. I'm using a 3 tier FrontController Design for my web application right now. The problem is that I'm finding to have to duplicate a lot of code for similar functions; for example, listing...
4
by: jason | last post by:
Hello. Newbie on SQL and suffering through this. I have two tables created as such: drop table table1; go drop table table2; go
16
by: Dario de Judicibus | last post by:
I'm getting crazy. Look at this code: #include <string.h> #include <stdio.h> #include <iostream.h> using namespace std ; char ini_code = {0xFF, 0xFE} ; char line_sep = {0x20, 0x28} ;
109
by: Andrew Thompson | last post by:
It seems most people get there JS off web sites, which is entirely logical. But it is also a great pity since most of that code is of such poor quality. I was looking through the JS FAQ for any...
5
by: ED | last post by:
I currently have vba code that ranks employees based on their average job time ordered by their region, zone, and job code. I currently have vba code that will cycle through a query and ranks each...
0
by: Namratha Shah \(Nasha\) | last post by:
Hey Guys, Today we are going to look at Code Access Security. Code access security is a feature of .NET that manages code depending on its trust level. If the CLS trusts the code enough to...
2
by: robboll | last post by:
I am looking for a VBA routine with a table (tblSentences) and one long field (field1) is the source tblSentences Field1 Did you know that a wild blueberry lies dormant for more than a year...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.