Quote:
Originally Posted by tekguru
Still getting:
PHP Code:
Database error in vBulletin 3.7.2:
Invalid SQL:
INSERT INTO vb_pollvote (pollid,userid,votedate,voteoption,votetype) VALUES ('32','2','1215514729','6','0');
MySQL Error : Duplicate entry '32-2-0' for key 2
Error Number : 1062
Request Date : Tuesday, July 8th 2008 @ 11:58:49 AM
Error Date : Tuesday, July 8th 2008 @ 11:58:50 AM
Script : http://www.4winmobile.com/forums/nominate_topic.php?do=nominate_topic_add&p=188842&securitytoken=1215514535-f4d5b334a5e5b51c957c2bc04eba1ddc7990ca2c
Referrer : http://www.4winmobile.com/forums/windows-chat-xp-mce2004-2005-vista/16712-rocketdock.html
IP Address : 78.86.46.67
Username : windows
Classname : vB_Database
MySQL Version : 5.0.51a-community
Looks like I will have to disable it, this is with running v1.22....
|
The following edit was made in "functions_nominate_topic.php" on v 1.22 to prevent that error:
Code:
if ($vote_option > 0){
$get_pollvote = $vbulletin->db->query_read("SELECT * FROM ". TABLE_PREFIX ."pollvote WHERE userid = '$user_id' AND pollid = '$poll_id' AND voteoption = '$vote_option' AND votetype ='$vote_option'");
$nb_pollvote = $vbulletin->db->num_rows($get_pollvote);
if ($nb_pollvote == 0){
$vbulletin->db->query_write("INSERT INTO " . TABLE_PREFIX . "pollvote (pollid,userid,votedate,voteoption,votetype) VALUES ('$poll_id','$user_id','$now','$vote_option','$vote_option')");
}
}
From your report:
Quote:
Database error in vBulletin 3.7.2:
Invalid SQL:
INSERT INTO vb_pollvote (pollid,userid,votedate,voteoption,votetype) VALUES ('32','2','1215514729','6','0');
|
$vote_option = 6, the same value is assigned to 'votetype' in the "functions_nominate_topic.php" up-to-date file, see code above, and not '
0' as shown on your feedback above, hence this error will not occur if you have the file "functions_nominate_topic.php" not up-to-date.
Redownload the attachment and upload the "functions_nominate_topic.php".