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

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

Author Topic: MySQL error on load?  (Read 3094 times)

0 Members and 1 Guest are viewing this topic.

Offline KingJ

  • BeBot Rookie
  • *
  • Posts: 10
  • Karma: +0/-0
MySQL error on load?
« on: March 31, 2006, 03:41:33 pm »
Restared the bot, looked at the bot window and saw an error

Quote from: Bot Window
MySQL error (# 0) on query: INSERT IGNORE INTO settings (setting, value) VALUES
('highlight_1', 'CB11C9>)
You have an error in your SQL syntax; check the manual that corresponds to your
MySQL server version for the right syntax to use near ''CB11C9>)' at line 1

This is the entire login / loading sequence (including error):
Quote from: Bot Window
Connected to MySQL
[2006-03-31 13:25:04]   [CORE]  [LOAD]  Admin.php
[2006-03-31 13:25:04]   [CORE]  [LOAD]  Alts.php
[2006-03-31 13:25:04]   [CORE]  [LOAD]  BotHelp.php
[2006-03-31 13:25:04]   [CORE]  [LOAD]  Online.php
[2006-03-31 13:25:04]   [CORE]  [LOAD]  Que.php
[2006-03-31 13:25:04]   [MOD]   [LOAD]  About.php
[2006-03-31 13:25:04]   [MOD]   [LOAD]  AlienAttack_GUILD.php
 [2006-03-31 13:25:04]  [MOD]   [LOAD]  AutoInv.php
[2006-03-31 13:25:04]   [MOD]   [LOAD]  AutoMsg.php
[2006-03-31 13:25:04]   [MOD]   [LOAD]  Bid.php
[2006-03-31 13:25:04]   [MOD]   [LOAD]  Bio.php
[2006-03-31 13:25:04]   [MOD]   [LOAD]  Calc.php
[2006-03-31 13:25:04]   [MOD]   [LOAD]  Callers.php
[2006-03-31 13:25:04]   [MOD]   [LOAD]  Countdown.php
[2006-03-31 13:25:04]   [MOD]   [LOAD]  GuildRelay_GUILD.php
[2006-03-31 13:25:04]   [MOD]   [LOAD]  IRC.php
[2006-03-31 13:25:04]   [MOD]   [LOAD]  Is.php
[2006-03-31 13:25:04]   [MOD]   [LOAD]  Items.php
[2006-03-31 13:25:04]   [MOD]   [LOAD]  Lag.php
[2006-03-31 13:25:04]   [MOD]   [LOAD]  Level.php
[2006-03-31 13:25:04]   [MOD]   [LOAD]  Logon_GUILD.php
[2006-03-31 13:25:04]   [MOD]   [LOAD]  MassMsg.php
[2006-03-31 13:25:04]   [MOD]   [LOAD]  News.php
[2006-03-31 13:25:04]   [MOD]   [LOAD]  Oe.php
[2006-03-31 13:25:04]   [MOD]   [LOAD]  Points.php
MySQL error (# 0) on query: INSERT IGNORE INTO settings (setting, value) VALUES
('highlight_1', 'CB11C9>)
You have an error in your SQL syntax; check the manual that corresponds to your
MySQL server version for the right syntax to use near ''CB11C9>)' at line 1
[2006-03-31 13:25:04]   [MOD]   [LOAD]  PrivGroup.php
[2006-03-31 13:25:04]   [MOD]   [LOAD]  Raffle.php
[2006-03-31 13:25:04]   [MOD]   [LOAD]  RaidTime.php
[2006-03-31 13:25:04]   [MOD]   [LOAD]  Rally.php
[2006-03-31 13:25:05]   [MOD]   [LOAD]  Relay_GUILD.php
[2006-03-31 13:25:05]   [MOD]   [LOAD]  Roll.php
[2006-03-31 13:25:05]   [MOD]   [LOAD]  Rooster_GUILD.php
[2006-03-31 13:25:05]   [MOD]   [LOAD]  Server.php
[2006-03-31 13:25:05]   [MOD]   [LOAD]  Shutdown.php
[2006-03-31 13:25:05]   [MOD]   [LOAD]  Target.php
[2006-03-31 13:25:05]   [MOD]   [LOAD]  Time.php
[2006-03-31 13:25:05]   [MOD]   [LOAD]  TowerAttack.php
[2006-03-31 13:25:05]   [MOD]   [LOAD]  Whois.php
[2006-03-31 13:25:05]   [LOGIN] [STATUS]        Connecting
[2006-03-31 13:25:06]   [LOGIN] [STATUS]        Authenticateing
[2006-03-31 13:25:06]   [LOGIN] [STATUS]        Logging in
[2006-03-31 13:25:06]   [LOGIN] [RESULT]        OK

I am running MySQL 5.0.3 Beta NTwith the php binaries included with bot.

Is this supposed to happen?

Offline Naturalistic

  • Contributor
  • *******
  • Posts: 221
  • Karma: +0/-0
Re: MySQL error on load?
« Reply #1 on: March 31, 2006, 06:29:54 pm »
Because you typo'd on the SQL.

Should read:
INSERT IGNORE INTO settings (setting, value) VALUES ('highlight_1', 'CB11C9')
220/25 Eternalist Doctor
-----------------------------
Campalot Coding Co-ordinator and Super Admin
http://www.campalot.info/index.php

Offline KingJ

  • BeBot Rookie
  • *
  • Posts: 10
  • Karma: +0/-0
Re: MySQL error on load?
« Reply #2 on: March 31, 2006, 08:05:34 pm »
Ok, fixed that. Now I get this error further down:

Quote from: Bot Window
[2006-03-31 18:03:57]   [MOD]   [LOAD]  Rally.php
MySQL error (# 0) on query: ALTER IGNORE TABLE guests ADD COLUMN name VARCHAR(25
) NOT NULL AFTER id
Duplicate column name 'name'
MySQL error (# 1) on query: ALTER IGNORE TABLE guests ADD COLUMN timeadd INT NOT
 NULL AFTER name
Duplicate column name 'timeadd'
MySQL error (# 2) on query: ALTER IGNORE TABLE guests ADD COLUMN addby VARCHAR(2
5) NOT NULL AFTER timeadd
Duplicate column name 'addby'
[2006-03-31 18:03:57]   [MOD]   [LOAD]  Relay_GUILD.php

These errors appear to be appearing in modules which I downloaded off here

Edit: Upon sumbitting news, I got this error in the bot (and the news didn't submit).

Quote from: Bot Window
[2006-03-31 18:07:50]   [TELL]  [INC]   Soleeet: news If you have lowbie alts, p
lease level them to get our org's average level up. The average level as of 31st
 March is: 38
MySQL error (# 0) on query: INSERT INTO news (id, name, news) VALUES (1143828470
, 'Soleeet', 'If you have lowbie alts, please level them to get our org's averag
e level up. The average level as of 31st March is: 38')
You have an error in your SQL syntax; check the manual that corresponds to your
MySQL server version for the right syntax to use near 's average level up. The a
verage level as of 31st March is: 38')' at line 1
[2006-03-31 18:07:50]   [TELL]  [OUT]   -> Soleeet: News has been added.[/news]
Think I might upgrade from 5.0.3 beta to 5 Stable, see if that helps.

Edit2: Upgrade didn't help with the errors, wasn't expecting it to though.
« Last Edit: March 31, 2006, 09:08:42 pm by KingJ »

Offline Naturalistic

  • Contributor
  • *******
  • Posts: 221
  • Karma: +0/-0
Re: MySQL error on load?
« Reply #3 on: March 31, 2006, 09:23:34 pm »
'If you have lowbie alts, please level them to get our org's average level up. The average level as of 31st March is: 38'

Should be:
'If you have lowbie alts, please level them to get our org\'s average level up. The average level as of 31st March is: 38'

You're using the ' in too many places, it exits the SQL query :)
220/25 Eternalist Doctor
-----------------------------
Campalot Coding Co-ordinator and Super Admin
http://www.campalot.info/index.php

Offline KingJ

  • BeBot Rookie
  • *
  • Posts: 10
  • Karma: +0/-0
Re: MySQL error on load?
« Reply #4 on: March 31, 2006, 09:40:31 pm »
Would it be possible to get the developers to add in automatic / insertion?

Thanks for your help so far :)

Offline Naturalistic

  • Contributor
  • *******
  • Posts: 221
  • Karma: +0/-0
Re: MySQL error on load?
« Reply #5 on: March 31, 2006, 09:49:25 pm »
No, any SQL that you do has to be done according to SQL standards :p

You could also do:

$varname = addslashes("If you have lowbie alts, please level them to get our org's average level up. The average level as of 31st March is: 38");

Or if you're getting the info from a command,
$varname = addslashes($msg);

Then inside the sql, just put '" . $varname . "' and that will add the fixed $msg.
220/25 Eternalist Doctor
-----------------------------
Campalot Coding Co-ordinator and Super Admin
http://www.campalot.info/index.php

Offline Xenixa

  • Contributor
  • *******
  • Posts: 307
  • Karma: +0/-0
Re: MySQL error on load?
« Reply #6 on: March 31, 2006, 11:02:15 pm »
For the ALTER IGNORE errors please read the commented code near the top in Relay_GUILD.php

Specifically:  // Comment out the 4 lines above if the columns already exsist.

For the News issue the function that insterts should look like this:
Code: [Select]
function set_news($name, $msg, $type)
{
if ($this -> bot -> guildbot || $this -> bot -> admin -> in_group($name, "admin"))
{
$this -> bot -> db -> query("INSERT INTO news (type, time, name, news) VALUES ('" . $type . "', " . time() .
", '" . $name . "', '" . addslashes($msg) . "')");
return "Thank you ".$name." your entry has been submitted.";
}
else
return "You must be an Admin to do this";
}

Note the addslashes($msg) in that bit of code.
<<< Hack's in Zend Studio

All my Custom Bebot files may be Found Here <-clicky

Offline KingJ

  • BeBot Rookie
  • *
  • Posts: 10
  • Karma: +0/-0
Re: MySQL error on load?
« Reply #7 on: March 31, 2006, 11:57:43 pm »
Ok, i'll try this out tomorrow (its getting a bit late over here) but before that I have another error for you to ponder over.

If the bot restarts (Manually through restart or because of connection loss), the bot does not actually restart. It will terminate and then run 'pause' in the cmd window which causes the message "Press Any Key to Continue..." in the cmd window. This causes the bot not to restart but sit there with a cmd window waiting for my input. I then have to execute the start.bat script again to get it working. At times, my internet can be quite unreliable and disconnect a few times per day. However, since it does not restart the bot is still unavailable even when it is back up again and requires user input.

Looking at the start.bat file, I see this

Quote from: Start.bat
@cls
@php -c ./ Main.php
pause

Surely putting pause into it dosen't do it much good but even if I took it out the window would terminate completely (and still not restart). Surely it is possible to get it to loop? I know very little batch file scripting and unfortunatly have no idea how to do loops in batch files. Any help would be appreciated.

Thanks again for all your help so far!

Offline KingJ

  • BeBot Rookie
  • *
  • Posts: 10
  • Karma: +0/-0
Re: MySQL error on load?
« Reply #8 on: April 01, 2006, 08:40:20 am »
Solved the start.bat problem, modified batch file is below:

Code: (Modified Start.bat) [Select]
:RUNBOT
@cls
@php -c ./ Main.php
GOTO RUNBOT

Offline Vhab

  • Contributor
  • *******
  • Posts: 180
  • Karma: +0/-0
    • VhaBot Forum
Re: MySQL error on load?
« Reply #9 on: April 01, 2006, 10:57:43 am »
I think bebot already has a loop like that in one of the php files and that batch file is 'working as intended'

 

* Recent Posts
Com bot module by bitnykk
[November 25, 2024, 05:36:11 pm ]


0.8.x updates for AO by bitnykk
[June 23, 2024, 03:19:47 pm ]


0.8.x updates for AoC by bitnykk
[June 23, 2024, 03:19:44 pm ]


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


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

* Who's Online
  • Dot Guests: 200
  • 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