Dear ePvPers community,
i have a little question, does anyone knows an SQL - script to "undelete" a deletet character.
My problem:
If an player on my server was hacked and his character is deleted after this, i want to recover the character and all Items.
I tryed to write an script with PHP but after this i became an ridiculous error message...
I am not so crazy to post my whole script but for the PHP-scripters i will post the important CODEs
Line 78 + 79
Line 96 + 97
Line 172 + 173
A short info to read the CODEs:
all this CODEs are scripted like this:
The variable "$recchar" is an array with the query from the user_character_secede.
i have a little question, does anyone knows an SQL - script to "undelete" a deletet character.
My problem:
If an player on my server was hacked and his character is deleted after this, i want to recover the character and all Items.
I tryed to write an script with PHP but after this i became an ridiculous error message...
Code:
Warning: mssql_query() [function.mssql-query]: message: Unclosed quotation mark before the character string '?'. (severity 15) in C:\Inetpub\vhosts\xp-dekaron.de\httpdocs\include\includes\recoverchar.php on line 79 Warning: mssql_query() [function.mssql-query]: message: Line 1: Incorrect syntax near '?'. (severity 15) in C:\Inetpub\vhosts\xp-dekaron.de\httpdocs\include\includes\recoverchar.php on line 79 Warning: mssql_query() [function.mssql-query]: Query failed in C:\Inetpub\vhosts\xp-dekaron.de\httpdocs\include\includes\recoverchar.php on line 79 Warning: mssql_query() [function.mssql-query]: Query failed in C:\Inetpub\vhosts\xp-dekaron.de\httpdocs\include\includes\recoverchar.php on line 97 Warning: mssql_query() [function.mssql-query]: message: Unclosed quotation mark before the character string ''. (severity 15) in C:\Inetpub\vhosts\xp-dekaron.de\httpdocs\include\includes\recoverchar.php on line 97 Warning: mssql_query() [function.mssql-query]: message: Line 1: Incorrect syntax near ''. (severity 15) in C:\Inetpub\vhosts\xp-dekaron.de\httpdocs\include\includes\recoverchar.php on line 97 Warning: mssql_query() [function.mssql-query]: message: Unclosed quotation mark before the character string ''. (severity 15) in C:\Inetpub\vhosts\xp-dekaron.de\httpdocs\include\includes\recoverchar.php on line 173 Warning: mssql_query() [function.mssql-query]: message: Line 1: Incorrect syntax near ''. (severity 15) in C:\Inetpub\vhosts\xp-dekaron.de\httpdocs\include\includes\recoverchar.php on line 173 Warning: mssql_query() [function.mssql-query]: Query failed in C:\Inetpub\vhosts\xp-dekaron.de\httpdocs\include\includes\recoverchar.php on line 173 Warning: mssql_query() [function.mssql-query]: message: Disallowed implicit conversion from data type varchar to data type varbinary, table 'character.dbo.user_slot', column 'info'. Use the CONVERT function to run this query. (severity 16) in C:\Inetpub\vhosts\xp-dekaron.de\httpdocs\include\includes\recoverchar.php on line 173
Line 78 + 79
Code:
$setbagquery = "INSERT INTO user_bag ([character_no], [line_no], [byHeader], [wIndex], [upt_time], [reg_bindate], [exp_bindate]) VALUES ('".$recchar["character_no"]."', '".$bag["line_no"]."', '".$bag["byHeader"]."', '".$bag["wIndex"]."', '".$bag["upt_time"]."', '".$bag["reg_bindate"]."', '".$bag["exp_bindate"]."')";
$setbag = mssql_query($setbagquery);
Code:
$setsuitquery = "INSERT INTO user_suit ([character_no], [line_no], [byHeader], [wIndex], [upt_time], [reg_bindate], [exp_bindate]) VALUES ('".$recchar["character_no"]."', '".$suit["line_no"]."', '".$suit["byHeader"]."', '".$suit["wIndex"]."', '".$suit["upt_time"]."', '".$suit["reg_bindate"]."', '".$suit["exp_bindate"]."')";
$setsuit = mssql_query($setsuitquery);
Code:
$setslotquery = "INSERT INTO user_slot ([character_no], [line_no], [info], [ipt_time], [upt_time]) VALUES ('".$recchar["character_no"]."', '".$slot["line_no"]."', '".$slot["info"]."', '".$slot["ipt_time"]."', '".$slot["upt_time"]."')";
$setslot = mssql_query($setslotquery);
all this CODEs are scripted like this:
Code:
if (mssql_num_rows ($searchbagausf) > 0) {
while ($bag = mssql_fetch_array($searchbagausf)) {
$setbagquery = "INSERT INTO user_bag ([character_no], [line_no], [byHeader], [wIndex], [upt_time], [reg_bindate], [exp_bindate]) VALUES ('".$recchar["character_no"]."', '".$bag["line_no"]."', '".$bag["byHeader"]."', '".$bag["wIndex"]."', '".$bag["upt_time"]."', '".$bag["reg_bindate"]."', '".$bag["exp_bindate"]."')";
$setbag = mssql_query($setbagquery);
}
$delbagquery = "DELETE FROM user_bag_secede WHERE [character_no] = '".$recchar["character_no"]."' ";
$delbag = mssql_query($delbagquery);
}
I hope someone can help me with this problem,
thanks in advanced
Yours Crystal
thanks in advanced
Yours Crystal