collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18363
  • stats Total Topics: 2500
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: Small error  (Read 1772 times)

0 Members and 1 Guest are viewing this topic.

Offline Capo

  • BeBot Rookie
  • *
  • Posts: 1
  • Karma: +0/-0
Small error
« on: August 05, 2009, 04:10:19 am »
Can anyone explain this one to me?   :)
Im pretty sure I installed everything correctly!

Curl extension loaded

Fatal error: Call to a member function log() on a non-object in C:\BeBot\Sources\MySQL.php on line 164


thx




Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: Small error
« Reply #1 on: August 05, 2009, 09:43:25 am »
This is an indication of a database error.

However the logging of such errors is currently not handled correctly at all and will itself cause crashes like you are experiencing.

As a temporary workaround open your Sources/MySQL.php file and find the function error on line 160
change it to the following
Code: [Select]
function error($text, $fatal = false)
{
$msg = mysql_error();
$this -> error_count++;
//$this -> bot -> log("MySQL", "ERROR", "(# " . $this -> error_count . ") on query: $text\n$msg", TRUE);

echo "MYSQL ERROR ""(# " . $this -> error_count . ") on query: $text\n$msg";

// If this error is occuring while we are trying to first connect to the database when starting
// rthe bot its a fatal error.
if ($fatal)
{
DIE("Fatal MySQL error");
}
}

This should allow you to see the actual MySQL error.

I'll look into it when i get home later today or tomorrow.
BeBot Founder and Fixer Kingpin

Offline Joe

  • BeBot Rookie
  • *
  • Posts: 2
  • Karma: +0/-0
Re: Small error
« Reply #2 on: August 14, 2009, 11:53:40 pm »
I had the same problem.

I added this line because yours was all messed up lol

Code: [Select]
echo "MYSQL ERROR (" . $this -> error_count . ") on query: $text\n$msg";

In my case, i accidently put the wrong database name in the config, but yeah error checking can be better.

but now the bot crashes php and it seg faults.

MySQL database connection test successfull
Segmentation fault (core dumped)

It doesnt work with php latest version 5.3. I compiled 5.2.10 and it works. Im not sure what the problem is or if its just my OS (freebsd) but it seems the sockets are crashing php and the bot doesnt run.

Also have a problem with the bot flooding mysql after about 60 seconds of running it, and crashing. Havent figured taht one out yet
« Last Edit: August 15, 2009, 05:14:40 pm by Joe »

 

* Recent Posts
[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm]


0.8.x updates for AoC by bitnykk
[January 30, 2024, 11:16:08 pm]


0.8.x updates for AO by bitnykk
[January 30, 2024, 11:15:37 pm]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am]


Bebot and Rasberry by bitnykk
[November 29, 2023, 11:04:14 pm]

* Who's Online
  • Dot Guests: 465
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal