| View previous topic :: View next topic |
| Author |
Message |
ShavdApe Halfop
Joined: 15 Dec 2003 Posts: 46
|
Posted: Sun Sep 27, 2009 1:20 pm Post subject: [SOLVED] mysql mod |
|
|
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 _________________ Driving lessons bolton
Last edited by ShavdApe on Mon Sep 28, 2009 2:55 am; edited 1 time in total |
|
| Back to top |
|
 |
raider2k Op
Joined: 01 Jan 2008 Posts: 140
|
Posted: Mon Sep 28, 2009 2:24 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
ShavdApe Halfop
Joined: 15 Dec 2003 Posts: 46
|
Posted: Mon Sep 28, 2009 2:52 am Post subject: |
|
|
Thanks for the reply appreciated works great too _________________ Driving lessons bolton |
|
| Back to top |
|
 |
raider2k Op
Joined: 01 Jan 2008 Posts: 140
|
Posted: Mon Sep 28, 2009 2:55 am Post subject: |
|
|
welcome
dont forget to add solved to the original posts topic please  |
|
| Back to top |
|
 |
|