PHPee.com PHP development forum
hits = hits + 1 WHERE TYPE = 'kw'

 
Post new topic   Reply to topic    phpee.com Forum Index -> PPhlogger Support
View previous topic :: View next topic  
Author Message
muffinchen



Joined: 27 Jul 2004
Posts: 3

PostPosted: Tue Jul 27, 2004 3:50 pm    Post subject: hits = hits + 1 WHERE TYPE = 'kw' Reply with quote
In case my website will be found via a search query in google for example, then it happens that my sql database will crash completely. When I check it via phpMyAdmin, it shows me the following process:
UPDATE pphl_20276_mpdl SET hits = hits + 1 WHERE TYPE = 'kw' AND url = 'search_query'
This process will never be finished (looping), so I will get a lot of unwanted hits Sad until the sql database will crash completely.
All other functions of pphlogger work fine, without any problems.

I tried to figure out, in which php-program the command "WHERE TYPE = 'kw'" is located, but couldn't find it, even checking all subdirectories.
Who can tell me, which program I have to check for it. Or even better - who can tell me, how to avoid this error ?

Thanks in advance

pphlogger 2.2.5
PHP Version 4.1.2
mySQL 3.22.32
Apache/1.3.26
Back to top
View user's profile Send private message
sdjl
Moderator


Joined: 17 Nov 2003
Posts: 751
Location: London, UK

PostPosted: Tue Jul 27, 2004 8:27 pm    Post subject: Reply with quote
Its simply adding the keywords that are searched for by a user into your database... It's counting how many times that search word is used in a search term.

I don't understand where the problem lies? There are plenty of sites that have busy hits from search engines that use pphlogger and have no problems...

David
_________________
-----
Free Logger Accounts | PPHlogger Manual | PM Me
Back to top
View user's profile Send private message Visit poster's website
muffinchen



Joined: 27 Jul 2004
Posts: 3

PostPosted: Tue Jul 27, 2004 10:33 pm    Post subject: hits = hits + 1 WHERE TYPE = 'kw' Reply with quote
Hi David,
thanks for your answer !

The problem is, that the counting of hits = hits + 1 will only stop, when I kill this sql process. So in the short time of maybe 30 seconds I will get hits. For me it seems that the program is looping?!

I also don't understand where the problem lies, that's why I try to find the program which is doing this counting of 'kw' hits. Could you tell me, which program it is and in which line number ? Then I could investigate why I get these problems. By the way, I'm programing PHP for many years - so you can believe me, that I have a real problem. Otherwise I would not ask here in the BB.

It would help me a lot, if I would know which program is doing the counting and where.

Thanks a lot !

sdjl wrote:

I don't understand where the problem lies? There are plenty of sites that have busy hits from search engines that use pphlogger and have no problems...

David
Back to top
View user's profile Send private message
sdjl
Moderator


Joined: 17 Nov 2003
Posts: 751
Location: London, UK

PostPosted: Wed Jul 28, 2004 7:11 am    Post subject: Reply with quote
If you've been programming for many years, you would open a PHP editor and do a search within files for the code you are after.
The only reason it should be looping is if there are more than one keyword to insert/count up in the database.

How can you tell that this process is looping? Or if the SQL query is actually just doing the job it is intended for?

David
_________________
-----
Free Logger Accounts | PPHlogger Manual | PM Me
Back to top
View user's profile Send private message Visit poster's website
muffinchen



Joined: 27 Jul 2004
Posts: 3

PostPosted: Wed Jul 28, 2004 7:59 am    Post subject: Reply with quote
sdjl wrote:
If you've been programming for many years, you would open a PHP editor and do a search within files for the code you are after.

That's exactly what I've done !

muffinchen wrote:
I tried to figure out, in which php-program the command "WHERE TYPE = 'kw'" is located, but couldn't find it, even checking all subdirectories.


sdjl wrote:
How can you tell that this process is looping? Or if the SQL query is actually just doing the job it is intended for?


I wrote "it seems to me that the program is looping?!" because this process will never finish and I'll receive additional 'kw'-hits in a very short time. This locks the pphl_#####_mpdl table, so the following pphlogger-processes will also hang, until SQL crashes completely because of too many active processes.

If you don't want to tell me which program I could check for it, then I have to continue my search for it.

Thank You David !
Back to top
View user's profile Send private message
sdjl
Moderator


Joined: 17 Nov 2003
Posts: 751
Location: London, UK

PostPosted: Wed Jul 28, 2004 10:52 am    Post subject: Reply with quote
It shouldn't hang or loop unless there is something seriously wrong with the code, which hasn't been reported before.
All that SQL query does, is take, lets say, a Google search query, checks the database table to see if the term exists already. If it does, then it adds one to the hit field and ends.

I don't know where the code is myself and won't be able to check until i get home. I'll have a look when i have the time for you and report any findings.
At the moment in time though, i still stand with my original answer: This doesn't loop, unless needed, and won't make your server hang.

David
_________________
-----
Free Logger Accounts | PPHlogger Manual | PM Me
Back to top
View user's profile Send private message Visit poster's website
Post new topic   Reply to topic    phpee.com Forum Index -> PPhlogger Support All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2.0.8
Theme design based on Team 101 Designs, modified by Philip Iezzi