473,669 Members | 2,372 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1538
On Jan 25, 11:04 am, "Cord-Heinrich Pahlmann" <S...@Heineken2 000.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.c omwrote:
On Jan 25, 11:04 am, "Cord-Heinrich Pahlmann" <S...@Heineken2 000.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_unbuffere d_query can lead to some funky results sometimes
though.
--
Rik Wasmus
Jan 26 '07 #3


On 26 Jan., 13:04, Rik <luiheidsgoe... @hotmail.comwro te:
On Fri, 26 Jan 2007 12:54:01 +0100, Curtis <dye...@gmail.c omwrote:
On Jan 25, 11:04 am, "Cord-Heinrich Pahlmann" <S...@Heineken2 000.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_unbuffere d_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_abo rt 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...@Heineken2 000.de>
wrote:
On 26 Jan., 13:04, Rik <luiheidsgoe... @hotmail.comwro te:
On Fri, 26 Jan 2007 12:54:01 +0100, Curtis <dye...@gmail.c omwrote:
On Jan 25, 11:04 am, "Cord-Heinrich Pahlmann" <S...@Heineken2 000.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_unbuffere d_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_abo rt 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_gener ator_blowfish.p hp#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
5255
by: Mudge | last post by:
Please, someone, tell me why OO in PHP is better than procedural.
3
1895
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 scripts on my Axim.
9
3859
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 users, and listing assignments use similar type commands. Is there a "better" way I can organize my code?
4
2426
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
3101
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
5855
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 question that identifies the warning signs to look out for, the things that most easily and clearly identify the author of code as something less than a master of the art. I did not find an FAQ that answered it, but I think the FAQ
5
4047
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 employee based on their region, zone, job code and avg job time. (See code below). My problem is that I do not know how to rank the ties. Right now if two people have the same avg time one will be ranked 3rd and the other ranked 4th. I would...
0
2083
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 allow it ro run then it will execute, the code execution depends on the permission provided to the assembly. If the code is not trusted wnough to run or it attempts to perform an action which doe not have the required permissions then its execution...
2
2161
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 between growing seasons? That's why we specially select our choice ingredients.
0
8465
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8383
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8894
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8803
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8587
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8658
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7407
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6210
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4384
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.