This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

[SOLVED] mysql mod

General support and discussion of Eggdrop bots.
Post Reply
S
ShavdApe
Halfop
Posts: 46
Joined: Mon Dec 15, 2003 5:22 pm

[SOLVED] mysql mod

Post by ShavdApe »

My bot dies when the mysql server goes down and while the server doesnt go down often it is a little frustrating so I wanted to know if there is anything I can do to prevent this happening as it also wont start back up if it cant connect to the mysql server.

Basically the code to connect is very simple so I wondered if I can add something to it to protect against it

# Connect to the database
loadmodule mysql
mysql_connect $database $host $user $pass
Last edited by ShavdApe on Mon Sep 28, 2009 2:55 am, edited 1 time in total.
r
raider2k
Op
Posts: 140
Joined: Tue Jan 01, 2008 10:42 am

Post by raider2k »

use catch in order to make the script quit upon a mysql error, also works for sql syntax errors to prevent the bot from dying.
S
ShavdApe
Halfop
Posts: 46
Joined: Mon Dec 15, 2003 5:22 pm

Post by ShavdApe »

Thanks for the reply appreciated :) works great too
r
raider2k
Op
Posts: 140
Joined: Tue Jan 01, 2008 10:42 am

Post by raider2k »

welcome ;)

dont forget to add solved to the original posts topic please ;)
Post Reply