PHPee.com PHP development forum
WARNING PHP
Goto page 1, 2  Next
 
Post new topic   Reply to topic    phpee.com Forum Index -> PPhlogger bug reports
View previous topic :: View next topic  
Author Message
purasorte



Joined: 15 Nov 2003
Posts: 12

PostPosted: Sun Nov 16, 2003 7:36 pm    Post subject: WARNING PHP Reply with quote
What does it means:
Code:
[Sun Nov 16 16:23:03 2003] [error] PHP Warning:  mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/xxxx/public_html/stats/libraries/functions.lib.php on line 493

I've many warnings like this.
Thank you
Back to top
View user's profile Send private message
purasorte



Joined: 15 Nov 2003
Posts: 12

PostPosted: Sun Nov 16, 2003 7:45 pm    Post subject: code Reply with quote
I forgot the code in "stats/libraries/functions.lib.php "
Code:
491 - $sql = "SELECT id, enabled FROM $table WHERE type = '".$type."' AND url = '".$url."'";
492 - $res = mysql_query($sql);
493 - if (!mysql_num_rows($res)) {
494 - $sql2 = "INSERT INTO $table (enabled,type,url,since,title) VALUES ($active,'$type','$url',$curr_gmt_time,'$title')";
495 - $res2 = mysql_query($sql2);
496 - return mysql_insert_id();
497 - } else {
Back to top
View user's profile Send private message
sdjl
Moderator


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

PostPosted: Mon Nov 17, 2003 10:11 am    Post subject: Reply with quote
What page were you on when this error occured?

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



Joined: 15 Nov 2003
Posts: 12

PostPosted: Mon Nov 17, 2003 5:23 pm    Post subject: Reply with quote
sdjl wrote:
What page were you on when this error occured?

I"ve about 300 pages using phplogger 2.5.
The main page is http://www.ojogodobicho.com/
This pages have 30.000 pageviews/day
May be this is the problem
Back to top
View user's profile Send private message
sdjl
Moderator


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

PostPosted: Mon Nov 17, 2003 10:23 pm    Post subject: Reply with quote
Ah right, so it actually appears when you try and display the logger output.
Is 30,000 unique hits? If so, it could be that.

Becuase the DB is being written to so often it might not be getting enough time to work out the num_rows.

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



Joined: 15 Nov 2003
Posts: 12

PostPosted: Mon Nov 17, 2003 10:40 pm    Post subject: Reply with quote
Thank you David
It's only 30.000 pageviews/day
I'll try upload all files again

Another question:
The data base is growing and growing. How to set PPhlogger to avoid this.
Sorry bad English

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


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

PostPosted: Mon Nov 17, 2003 11:33 pm    Post subject: Reply with quote
I would imagine your site has too many hits for the logger to handle. I think it was said that over 10,000 hits per day would start to cause performance issues.

I find that removing keywords and multi-pages every once in a while helps stop the database growing in size.

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



Joined: 15 Nov 2003
Posts: 12

PostPosted: Fri Nov 21, 2003 1:07 am    Post subject: 2 warnings Reply with quote
Thank you David

After re-upload the files I get not 1 but 2 warnings each time Embarassed :
Code:
[Thu Nov 20 20:59:19 2003] [error] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/xxxxx/public_html/stats/libraries/functions.lib.php:493) in /home/ljogo/public_html/stats/pphlogger.php on line 226
[Thu Nov 20 20:59:19 2003] [error] PHP Warning:  mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/xxxxx/public_html/stats/libraries/functions.lib.php on line 493

I really would like to use phplogger but it don't like me Smile

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


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

PostPosted: Fri Nov 21, 2003 1:20 am    Post subject: Reply with quote
When i visit that URL you provided, i can see no errors?
Have you got it fixed?

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



Joined: 15 Nov 2003
Posts: 12

PostPosted: Fri Nov 21, 2003 2:41 am    Post subject: error Reply with quote
There are no errors, thereare warnings in the serverlog's

During a day the warnings appears about 100 times to about 30000 pageviews.

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


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

PostPosted: Fri Nov 21, 2003 11:48 pm    Post subject: Reply with quote
Oh right!!
I understand what you mean now!
Should have mentioned "serverlog" from the beginning!

I also get these errors in my server logs, ill have a look into it and see what the issue could be and post any resolve that i find Smile

David
_________________
-----
PPHlogger Manual | PM Me
Back to top
View user's profile Send private message Visit poster's website
sdjl
Moderator


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

PostPosted: Sat Nov 22, 2003 12:04 am    Post subject: Reply with quote
Ok, i think i've found the problem.
I'm just going to do some checks to verify that this is the problem.

I'll post again with an update shortly.

David
_________________
-----
PPHlogger Manual | PM Me
Back to top
View user's profile Send private message Visit poster's website
sdjl
Moderator


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

PostPosted: Sat Nov 22, 2003 12:19 am    Post subject: Reply with quote
Ok, here's what i think has happened:

When the pphlogger.php file tries to insert keywords into the relevant users _mpdl database table it doesn't pass the table name over to the function correctly.
This means that because it has a blank table name, when it tries to execute the SQL it fails and returns the errors logged in your server logs.

I'm not entirely sure if this a successful edit or not, only time will tell really!
I have tested it though and it doesn't appear to cause any issues/errors to the current setup.

Here's what you need to do:

1) Locate the following code in pphlogger.php (Line: 190ish)
Code:
insert_keyw($keywrd[3]);


2) Replace the above code with the following:
Code:
insert_keyw($keywrd[3], $tbl_mpdl);


The new code basically defines the table to be used when inserting keywords.

Give it a day or two and see if your server log file cuts down in size.

Keep me posted!

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



Joined: 15 Nov 2003
Posts: 12

PostPosted: Sat Nov 22, 2003 2:47 am    Post subject: Reply with quote
sdjl wrote:
Oh right!!
I understand what you mean now!
Should have mentioned "serverlog" from the beginning!

Sorry

Hello David,
I made the changes posted here.
I'll tell you soom about the results.
Thank You very much

Luiz
Back to top
View user's profile Send private message
purasorte



Joined: 15 Nov 2003
Posts: 12

PostPosted: Mon Dec 01, 2003 11:12 pm    Post subject: Mr. Google Reply with quote
The warnings continues:
Code:
Mon Dec  1 17:36:26 2003] [error] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/xxxxx/public_html/stats/libraries/functions.lib.php:493) in /home/ljogo/public_html/stats/pphlogger.php on line 226
[Mon Dec  1 17:36:26 2003] [error] PHP Warning:  mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/xxxxx/public_html/stats/libraries/functions.lib.php on line 493


but something of new appeared: I analyzed acesslog of the server and discovered that all the warnings are being generated for visits comings of the Google. He looks at the examples below:
Code:
- - [01/Dec/2003:17:36:26 -0200] "GET /stats/pphlogger.php?id=purasorte&referer=http%3A//www.google.com.br/search%3Fq%3D%2522sonhos%2522%26ie%3DUTF-8%26oe%3DUTF-8%26hl%3Dpt-BR%26btnG%3DPesquisa+Google%26meta%3Dlr%253Dlang_pt&r=800x600&c=16&showme=n&st=js&title=sonhos HTTP/1.1" 200 499 "http://www.ojogodobicho.com/sonhosindice.htm" "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)"

another example:
Code:
- - [01/Dec/2003:16:42:37 -0200] "GET /stats/pphlogger.php?id=purasorte&referer=http%3A//www.google.com.br/search%3Fq%3D%2522jogo+do+bicho%2522%26ie%3DUTF-8%26oe%3DUTF-8%26hl%3Dpt-BR%26meta%3D&r=800x600&c=32&showme=n&st=js&title=jogo%20do%20bicho HTTP/1.0" 200 487 "http://www.ojogodobicho.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"


Some idea ?

Luiz
Back to top
View user's profile Send private message
Post new topic   Reply to topic    phpee.com Forum Index -> PPhlogger bug reports All times are GMT + 1 Hour
Goto page 1, 2  Next
Page 1 of 2

 
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
Theme design based on Team 101 Designs, modified by Philip Iezzi