PDA

View Full Version : Database error in vBulletin 3.7.0: MySQL Error : Duplicate entry 'activateform-1-te


Sanjiyan
Sun 11th May '08, 5:08pm
hi there, I am getting a mysql database error, when I try to do a template search and replace (with the test set to NO).

my search string was: <input type="hidden" name="s" value="$session[sessionhash]" />
The error emailed to me is:

Database error in vBulletin 3.7.0:

Invalid SQL:

INSERT INTO template
(styleid, title, template, template_un, dateline, username, version, product)
VALUES
(1,
'activateform',
'$stylevar[htmldoctype]\r\n<html xmlns=\\\"http://www.w3.org/1999/xhtml\\\ (http://www.w3.org/1999/xhtml%5C%5C%5C)" dir=\\\"$stylevar[textdirection]\\\" lang=\\\"$stylevar[languagecode]\\\">\r\n<head>\r\n$headinclude\r\n<title>\" . $GLOBALS[\'vbulletin\']->options[\'bbtitle\'] . \" - $vbphrase[activate_your_account]</title>\r\n</head>\r\n<body>\r\n$header\r\n\".(($navbar) ? (\"$navbar\") : (\"<br /><br />\")).\"\r\n\r\n<form action=\\\"register.php?do=activate\\\" method=\\\"post\\\">\r\n\r\n<table class=\\\"tborder\\\" cellpadding=\\\"$stylevar[cellpadding]\\\" cellspacing=\\\"$stylevar[cellspacing]\\\" border=\\\"0\\\" width=\\\"100%\\\" align=\\\"center\\\">\r\n<tr>\r\n <td class=\\\"tcat\\\">$vbphrase[activate_your_account]</td>\r\n</tr>\r\n<tr>\r\n <td class=\\\"panelsurround\\\" align=\\\"center\\\">\r\n <div class=\\\"panel\\\">\r\n <div style=\\\"width:$stylevar[formwidth]\\\" align=\\\"$stylevar[left]\\\">\r\n\r\n <fieldset class=\\\"fieldset\\\">\r\n <legend>$vbphrase[activate_your_account]</!
legend>\r\n <table cellpadding=\\\"0\\\" cellspacing=\\\"$stylevar[formspacer]\\\" border=\\\"0\\\">\r\n <tr>\r\n <td>\r\n $vbphrase[username]:<br />\r\n <input type=\\\"text\\\" class=\\\"bginput\\\" size=\\\"50\\\" name=\\\"username\\\" value=\\\"\" . $GLOBALS[\'vbulletin\']->userinfo[\'username\'] . \"\\\" />\r\n </td>\r\n </tr>\r\n <tr>\r\n <td>\r\n $vbphrase[activation_code]:<br />\r\n <input type=\\\"text\\\" class=\\\"bginput\\\" size=\\\"50\\\" name=\\\"activateid\\\" />\r\n </td>\r\n </tr>\r\n </table>\r\n </fieldset>\r\n\r\n <div class=\\\"fieldset\\\" style=\\\"margin:$stylevar[formspacer]px 0px 0px 0px\\\">\r\n \" . construct_phrase(\"$vbphrase[you_lost_activation_code_or_username]\", \"register.php?\" . $GLOBALS[\'vbulletin\']->session->vars[\'sessionurl\'] . \"do=requestemail\") . \"\r\n </div>\r\n\r\n </div>\r\n </div>\r\n\r\n <div style=\\\"margin-top:$stylevar[cellpadding]px\\\">\r\n \r\n <input type=\\\"hidde!
n\\\" name=\\\"securitytoken\\\" value=\\\"\" . $GLOBALS[\'vbu!
lletin\'
]->userinfo[\'securitytoken\'] . \"\\\" />\r\n <input type=\\\"hidden\\\" name=\\\"do\\\" value=\\\"activate\\\" />\r\n <input type=\\\"submit\\\" class=\\\"button\\\" value=\\\"$vbphrase[activate_your_account]\\\" accesskey=\\\"s\\\" />\r\n <input type=\\\"reset\\\" class=\\\"button\\\" name=\\\"reset\\\" value=\\\"$vbphrase[reset_fields]\\\" accesskey=\\\"r\\\" />\r\n </div>\r\n </td>\r\n</tr>\r\n</table>\r\n\r\n</form>\r\n\r\n$footer\r\n\r\n</body>\r\n</html>',
'$stylevar[htmldoctype]\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\ (http://www.w3.org/1999/xhtml%5C)" dir=\"$stylevar[textdirection]\" lang=\"$stylevar[languagecode]\">\r\n<head>\r\n$headinclude\r\n<title>$vboptions[bbtitle] - $vbphrase[activate_your_account]</title>\r\n</head>\r\n<body>\r\n$header\r\n<if condition=\"$navbar\">$navbar<else /><br /><br /></if>\r\n\r\n<form action=\"register.php?do=activate\" method=\"post\">\r\n\r\n<table class=\"tborder\" cellpadding=\"$stylevar[cellpadding]\" cellspacing=\"$stylevar[cellspacing]\" border=\"0\" width=\"100%\" align=\"center\">\r\n<tr>\r\n <td class=\"tcat\">$vbphrase[activate_your_account]</td>\r\n</tr>\r\n<tr>\r\n <td class=\"panelsurround\" align=\"center\">\r\n <div class=\"panel\">\r\n <div style=\"width:$stylevar[formwidth]\" align=\"$stylevar[left]\">\r\n\r\n <fieldset class=\"fieldset\">\r\n <legend>$vbphrase[activate_your_account]</legend>\r\n <table cellpadding=\"0\" cellspacing=\"$stylevar[formspacer]\" border=\"0\">\r\n <tr>\r\!
n <td>\r\n $vbphrase[username]:<br />\r\n <input type=\"text\" class=\"bginput\" size=\"50\" name=\"username\" value=\"$bbuserinfo[username]\" />\r\n </td>\r\n </tr>\r\n <tr>\r\n <td>\r\n $vbphrase[activation_code]:<br />\r\n <input type=\"text\" class=\"bginput\" size=\"50\" name=\"activateid\" />\r\n </td>\r\n </tr>\r\n </table>\r\n </fieldset>\r\n\r\n <div class=\"fieldset\" style=\"margin:$stylevar[formspacer]px 0px 0px 0px\">\r\n <phrase 1=\"register.php?$session[sessionurl]do=requestemail\">$vbphrase[you_lost_activation_code_or_username]</phrase>\r\n </div>\r\n\r\n </div>\r\n </div>\r\n\r\n <div style=\"margin-top:$stylevar[cellpadding]px\">\r\n \r\n <input type=\"hidden\" name=\"securitytoken\" value=\"$bbuserinfo[securitytoken]\" />\r\n <input type=\"hidden\" name=\"do\" value=\"activate\" />\r\n <input type=\"submit\" class=\"button\" value=\"$vbphrase[activate_your_account]\" accesskey=\"s\" />\r\n <input type=\"reset!
\" class=\"button\" name=\"reset\" value=\"$vbphrase[reset_fie!
lds]\" a
ccesskey=\"r\" />\r\n </div>\r\n </td>\r\n</tr>\r\n</table>\r\n\r\n</form>\r\n\r\n$footer\r\n\r\n</body>\r\n</html>',
1210535393,
'Sanjiyan',
'3.7.0',
'vbulletin');

MySQL Error : Duplicate entry 'activateform-1-template' for key 2
Error Number : 1062
Request Date : Sunday, May 11th 2008 @ 09:49:53 PM
Error Date : Sunday, May 11th 2008 @ 09:49:53 PM
Script : http://www.eve-atf.com/forum/admincp/template.php?do=replace
Referrer : http://www.eve-atf.com/forum/admincp/template.php?do=search
IP Address : xxx.xxx.xxx.xxx
Username : Sanjiyan
Classname : vB_Database_MySQLi
MySQL Version : 5.0.22Why is says insert I have no idea, I'm only doing a search it gets to a few hits on the search and then it errors out (see attachment)

Jake Bunce
Mon 12th May '08, 3:20pm
That looks like a problem with your unique indexes. Try running this option:

Admin CP -> Maintenance -> Repair / Optimize Tables -> Fix Unique Indexes (at the bottom)