vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Competitions (https://vborg.vbsupport.ru/showthread.php?t=100150)

husain 11-07-2005 05:51 AM

Quote:

Originally Posted by peterska2
Well it took me about 3 dozen attempts to install including having to re-write the XML and manually do the queries, but eventually we got there and it now works.

On the whole, a nice little hack, but a complete ball ache to get working. I recommend you revisit your XML and check it over again.

Could you please tell me what problems you faced, error messages you got, etc. Your feedback will help me in checking where the problem lies. Thank you.

VaaKo 11-07-2005 06:53 AM

I got this when I first tried to upload the plugin

Code:

Database error in vBulletin 3.5.1:

Invalid SQL:

CREATE TABLE `hkc_competitions` (
  `competitionid` smallint(5) unsigned NOT NULL auto_increment,
  `title` varchar(255) NOT NULL default '',
  `description` mediumtext NOT NULL,
  `type` enum('input','select','radio','textarea','checkbox','select_multiple') NOT NULL default 'input',
  `data` mediumtext NOT NULL,
  `maxlength` smallint(6) NOT NULL default '250',
  `size` smallint(6) NOT NULL default '25',
  `height` smallint(6) NOT NULL default '0',
  `optional` smallint(5) unsigned NOT NULL default '0',
  `def` smallint(6) NOT NULL default '0',
  `regex` varchar(255) NOT NULL default '',
  `enddate` int(10) unsigned NOT NULL default '0',
  `datestamp` int(10) unsigned NOT NULL default '0',
  `correctanswer` mediumtext NOT NULL,
  `entrycount` mediumint(8) unsigned NOT NULL default '0',
  `maxentries` smallint(5) unsigned NOT NULL default '1',
  `maxwinners` smallint(5) unsigned NOT NULL default '1',
  `winnercount` smallint(5) unsigned NOT NULL default '0',
  `enableguidelines` tinyint(1) NOT NULL default '1',
  PRIMARY KEY  (`competitionid`),
  KEY `enddate` (`enddate`)
) TYPE=MyISAM;;

MySQL Error  : You have an error in your SQL syntax near ';
' at line 24
Error Number : 1064
Date        : Monday, November 7th 2005 @ 02:59:28 PM
Script      : http://www.oneforum.org/admincp/plugin.php
Referrer    : http://www.oneforum.org/admincp/plugin.php?do=productadd
IP Address  : 194.146.154.1
Username    : Snitz
Classname    : vb_database


husain 11-07-2005 07:16 AM

That's strange. The SQL in the XML file doesn't have 2 semi-colons at the end.

I also installed this hack on a vanilla copy of vBulletin 3.5 and I didn't get any errors.

VaaKo 11-07-2005 07:24 AM

what could be cause of this error than?
I recently upgraded to 3.5.1, could it be the reason?

peterska2 11-07-2005 10:07 AM

Mine's a 3.5.1 too.

Have a list of errors with what I had done below each one and what I did to fix it. :)

Please note: every error was obtained via the product import function when set to overwrite exisiting.

Quote:

Originally Posted by error one
Database error in vBulletin 3.5.1:

Invalid SQL:

CREATE TABLE `hkc_competitions` (
`competitionid` smallint(5) unsigned NOT NULL auto_increment,
`title` varchar(255) NOT NULL default '',
`description` mediumtext NOT NULL,
`type` enum('input','select','radio','textarea','checkbox ','select_multiple') NOT NULL default 'input',
`data` mediumtext NOT NULL,
`maxlength` smallint(6) NOT NULL default '250',
`size` smallint(6) NOT NULL default '25',
`height` smallint(6) NOT NULL default '0',
`optional` smallint(5) unsigned NOT NULL default '0',
`def` smallint(6) NOT NULL default '0',
`regex` varchar(255) NOT NULL default '',
`enddate` int(10) unsigned NOT NULL default '0',
`datestamp` int(10) unsigned NOT NULL default '0',
`correctanswer` mediumtext NOT NULL,
`entrycount` mediumint(8) unsigned NOT NULL default '0',
`maxentries` smallint(5) unsigned NOT NULL default '1',
`maxwinners` smallint(5) unsigned NOT NULL default '1',
`winnercount` smallint(5) unsigned NOT NULL default '0',
`enableguidelines` tinyint(1) NOT NULL default '1',
PRIMARY KEY (`competitionid`),
KEY `enddate` (`enddate`)
) TYPE=MyISAM;;

MySQL Error : You have an error in your SQL syntax near ';
' at line 24
Error Number : 1064
Date : Sunday, November 6th 2005 @ 11:47:35 PM
Script : http://www.peterska2.co.uk/admincp/plugin.php
Referrer : http://www.peterska2.co.uk/admincp/p...?do=productadd
IP Address :
Username : peterska2
Classname : vb_database

Initial import of product. Fixed error by removing the ; at the end of above query. In the xml file you have
Code:

) TYPE=MyISAM;
";

which is where you are getting the double ;; from.

Quote:

Originally Posted by error two
Database error in vBulletin 3.5.1:

Invalid SQL:
ALTER TABLE usergroup ADD hkc_competition_permissions INT(10) UNSIGNED DEFAULT '1' NOT NULL;

MySQL Error : Duplicate column name 'hkc_competition_permissions' Error Number : 1060
Date : Sunday, November 6th 2005 @ 11:50:58 PM
Script : http://www.peterska2.co.uk/admincp/plugin.php
Referrer : http://www.peterska2.co.uk/admincp/p...?do=productadd
IP Address :
Username : peterska2
Classname : vb_database

Re-import brought this error. Could not uninstall product as the install had not been completed. Tried again.

Quote:

Originally Posted by error three
Database error in vBulletin 3.5.1:

Invalid SQL:
ALTER TABLE usergroup ADD hkc_competition_permissions INT(10) UNSIGNED DEFAULT '1' NOT NULL;

MySQL Error : Duplicate column name 'hkc_competition_permissions' Error Number : 1060
Date : Sunday, November 6th 2005 @ 11:52:34 PM
Script : http://www.peterska2.co.uk/admincp/plugin.php
Referrer : http://www.peterska2.co.uk/admincp/p...?do=productadd
IP Address :
Username : peterska2
Classname : vb_database

Error upon re-import overwrite existing set to yes. Edited XML to eliminate this query and bypass the error, but forgot to upload it.

Quote:

Originally Posted by error four
Database error in vBulletin 3.5.1:

Invalid SQL:
ALTER TABLE usergroup ADD hkc_competition_permissions INT(10) UNSIGNED DEFAULT '1' NOT NULL;

MySQL Error : Duplicate column name 'hkc_competition_permissions' Error Number : 1060
Date : Sunday, November 6th 2005 @ 11:53:39 PM
Script : http://www.peterska2.co.uk/admincp/plugin.php
Referrer : http://www.peterska2.co.uk/admincp/p...?do=productadd
IP Address :
Username : peterska2
Classname : vb_database

Error upon re-import overwrite existing set to yes. Uploaded edited XML.

Quote:

Originally Posted by error five
Database error in vBulletin 3.5.1:

Invalid SQL:

CREATE TABLE `` (
`competitionid` smallint(5) unsigned NOT NULL auto_increment,
`title` varchar(255) NOT NULL default '',
`description` mediumtext NOT NULL,
`type` enum('input','select','radio','textarea','checkbox ','select_multiple') NOT NULL default 'input',
`data` mediumtext NOT NULL,
`maxlength` smallint(6) NOT NULL default '250',
`size` smallint(6) NOT NULL default '25',
`height` smallint(6) NOT NULL default '0',
`optional` smallint(5) unsigned NOT NULL default '0',
`def` smallint(6) NOT NULL default '0',
`regex` varchar(255) NOT NULL default '',
`enddate` int(10) unsigned NOT NULL default '0',
`datestamp` int(10) unsigned NOT NULL default '0',
`correctanswer` mediumtext NOT NULL,
`entrycount` mediumint(8) unsigned NOT NULL default '0',
`maxentries` smallint(5) unsigned NOT NULL default '1',
`maxwinners` smallint(5) unsigned NOT NULL default '1',
`winnercount` smallint(5) unsigned NOT NULL default '0',
`enableguidelines` tinyint(1) NOT NULL default '1',
PRIMARY KEY (`competitionid`),
KEY `enddate` (`enddate`)
) TYPE=MyISAM;;

MySQL Error : Incorrect table name ''
Error Number : 1103
Date : Sunday, November 6th 2005 @ 11:54:43 PM
Script : http://www.peterska2.co.uk/admincp/plugin.php
Referrer : http://www.peterska2.co.uk/admincp/p...?do=productadd
IP Address :
Username : peterska2
Classname : vb_database

Got a bit carried away when editing the xml and so had to go back and manually insert the table names.

Quote:

Originally Posted by error six
Database error in vBulletin 3.5.1:

Invalid SQL:

CREATE TABLE `hkc_competitions` (
`competitionid` smallint(5) unsigned NOT NULL auto_increment,
`title` varchar(255) NOT NULL default '',
`description` mediumtext NOT NULL,
`type` enum('input','select','radio','textarea','checkbox ','select_multiple') NOT NULL default 'input',
`data` mediumtext NOT NULL,
`maxlength` smallint(6) NOT NULL default '250',
`size` smallint(6) NOT NULL default '25',
`height` smallint(6) NOT NULL default '0',
`optional` smallint(5) unsigned NOT NULL default '0',
`def` smallint(6) NOT NULL default '0',
`regex` varchar(255) NOT NULL default '',
`enddate` int(10) unsigned NOT NULL default '0',
`datestamp` int(10) unsigned NOT NULL default '0',
`correctanswer` mediumtext NOT NULL,
`entrycount` mediumint(8) unsigned NOT NULL default '0',
`maxentries` smallint(5) unsigned NOT NULL default '1',
`maxwinners` smallint(5) unsigned NOT NULL default '1',
`winnercount` smallint(5) unsigned NOT NULL default '0',
`enableguidelines` tinyint(1) NOT NULL default '1',
PRIMARY KEY (`competitionid`),
KEY `enddate` (`enddate`)
) TYPE=MyISAM;;

MySQL Error : You have an error in your SQL syntax near ';
' at line 24
Error Number : 1064
Date : Sunday, November 6th 2005 @ 11:55:28 PM
Script : http://www.peterska2.co.uk/admincp/plugin.php
Referrer : http://www.peterska2.co.uk/admincp/p...?do=productadd
IP Address :
Username : peterska2
Classname : vb_database

Problem with double ;; again. See error one for solution.

Quote:

Originally Posted by error seven
Database error in vBulletin 3.5.1:

Invalid SQL:

CREATE TABLE `hkc_entries` (
`entryid` int(10) unsigned NOT NULL auto_increment,
`competitionid` smallint(5) unsigned NOT NULL default '0',
`userid` int(10) unsigned NOT NULL default '0',
`answer` mediumtext NOT NULL,
`entrydate` int(11) NOT NULL default '0',
PRIMARY KEY (`entryid`),
KEY `competitionid_userid` (`competitionid`,`userid`)
) TYPE=MyISAM;;

MySQL Error : You have an error in your SQL syntax near ';
' at line 10
Error Number : 1064
Date : Sunday, November 6th 2005 @ 11:57:42 PM
Script : http://www.peterska2.co.uk/admincp/plugin.php
Referrer : http://www.peterska2.co.uk/admincp/p...?do=productadd
IP Address :
Username : peterska2
Classname : vb_database

Problem with double ;; again. See error one for solution.

Quote:

Originally Posted by error eight
Database error in vBulletin 3.5.1:

Invalid SQL:

CREATE TABLE `hkc_winners` (
`competitionid` smallint(5) unsigned NOT NULL default '0',
`userid` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`competitionid`,`userid`)
) TYPE=MyISAM;;

MySQL Error : You have an error in your SQL syntax near ';
' at line 6
Error Number : 1064
Date : Sunday, November 6th 2005 @ 11:58:14 PM
Script : http://www.peterska2.co.uk/admincp/plugin.php
Referrer : http://www.peterska2.co.uk/admincp/p...?do=productadd
IP Address :
Username : peterska2
Classname : vb_database

Problem with double ;; again. See error one for solution.

Quote:

Originally Posted by error nine
Database error in vBulletin 3.5.1:

Invalid SQL:

CREATE TABLE `hkc_competitions` (
`competitionid` smallint(5) unsigned NOT NULL auto_increment,
`title` varchar(255) NOT NULL default '',
`description` mediumtext NOT NULL,
`type` enum('input','select','radio','textarea','checkbox ','select_multiple') NOT NULL default 'input',
`data` mediumtext NOT NULL,
`maxlength` smallint(6) NOT NULL default '250',
`size` smallint(6) NOT NULL default '25',
`height` smallint(6) NOT NULL default '0',
`optional` smallint(5) unsigned NOT NULL default '0',
`def` smallint(6) NOT NULL default '0',
`regex` varchar(255) NOT NULL default '',
`enddate` int(10) unsigned NOT NULL default '0',
`datestamp` int(10) unsigned NOT NULL default '0',
`correctanswer` mediumtext NOT NULL,
`entrycount` mediumint(8) unsigned NOT NULL default '0',
`maxentries` smallint(5) unsigned NOT NULL default '1',
`maxwinners` smallint(5) unsigned NOT NULL default '1',
`winnercount` smallint(5) unsigned NOT NULL default '0',
`enableguidelines` tinyint(1) NOT NULL default '1',
PRIMARY KEY (`competitionid`),
KEY `enddate` (`enddate`)
) TYPE=MyISAM;

MySQL Error : Table 'hkc_competitions' already exists
Error Number : 1050
Date : Sunday, November 6th 2005 @ 11:59:27 PM
Script : http://www.peterska2.co.uk/admincp/plugin.php
Referrer : http://www.peterska2.co.uk/admincp/p...?do=productadd
IP Address :
Username : peterska2
Classname : vb_database

Adding query manually gave this error. I had already added it manually eariler in the install process and just completely forgot - I was fed up getting errors by this point.

Quote:

Originally Posted by error ten
Database error in vBulletin 3.5.1:

Invalid SQL:

CREATE TABLE `hkc_competitions` (
`competitionid` smallint(5) unsigned NOT NULL auto_increment,
`title` varchar(255) NOT NULL default '',
`description` mediumtext NOT NULL,
`type` enum('input','select','radio','textarea','checkbox ','select_multiple') NOT NULL default 'input',
`data` mediumtext NOT NULL,
`maxlength` smallint(6) NOT NULL default '250',
`size` smallint(6) NOT NULL default '25',
`height` smallint(6) NOT NULL default '0',
`optional` smallint(5) unsigned NOT NULL default '0',
`def` smallint(6) NOT NULL default '0',
`regex` varchar(255) NOT NULL default '',
`enddate` int(10) unsigned NOT NULL default '0',
`datestamp` int(10) unsigned NOT NULL default '0',
`correctanswer` mediumtext NOT NULL,
`entrycount` mediumint(8) unsigned NOT NULL default '0',
`maxentries` smallint(5) unsigned NOT NULL default '1',
`maxwinners` smallint(5) unsigned NOT NULL default '1',
`winnercount` smallint(5) unsigned NOT NULL default '0',
`enableguidelines` tinyint(1) NOT NULL default '1',
PRIMARY KEY (`competitionid`),
KEY `enddate` (`enddate`)
) TYPE=MyISAM;

MySQL Error : Table 'hkc_competitions' already exists
Error Number : 1050
Date : Monday, November 7th 2005 @ 12:00:41 AM
Script : http://www.peterska2.co.uk/admincp/plugin.php
Referrer : http://www.peterska2.co.uk/admincp/p...?do=productadd
IP Address :
Username : peterska2
Classname : vb_database

Again forgot that I had already manually added this table.

Quote:

Originally Posted by error eleven
Database error in vBulletin 3.5.1:

Invalid SQL:
INSERT INTO hkc_winners (competitionid, userid) VALUES (1, 1);

MySQL Error : Table 'talkyaAn.hkc_winners' doesn't exist
Error Number : 1146
Date : Monday, November 7th 2005 @ 12:06:24 AM
Script : http://www.peterska2.co.uk/admincp/c...ionmanager.php
Referrer : http://www.peterska2.co.uk/admincp/c...ompetitionid=1
IP Address :
Username : peterska2
Classname : vb_database

Addition of this table failed. Had to manually create.

I'd send you a copy of my XML file but it's got big chunks missing so it probably isn't a good idea. However, if you wish to have a copy for your reference then I will be happy to send it over.

[high]* peterska2 hopes this post isn't over the character limit![/high]

husain 11-07-2005 12:07 PM

peterska2, thanks for your detailed report. I really appreciate your efforts and patience. I would like to have your copy of the XML file. I can use that to fix my XML file. You can email the file to me at husainsfabbas AT hotmail.com

From your error report, is it safe to assume that all problems faced were because of poorly written SQL queries?

Holidazed 11-07-2005 12:27 PM

I installed this mod and it seems to be working properly as long as I am using internet explorer. When I goto my site in Firefox, none of the dhtml drop down menus work and the shoutbox does not load and various other java functions do not work.

When I disable this product, all is working again.

Paul M 11-07-2005 01:05 PM

Quote:

Originally Posted by husain
From your error report, is it safe to assume that all problems faced were because of poorly written SQL queries?

Most of the errors appear to be due to the extra semi colon.

Also, once you know the sql is correct, you should add the following line to the start of your installation code;

PHP Code:

$db->hide_errors() 

and this to the end;

PHP Code:

$db->show_errors() 

The simple reason being that if tables or columns already exist then failure messages are expected, but need to be ignored.

husain 11-07-2005 03:30 PM

Thanks for the tip Paul. I have uploaded another copy of the ZIP file to incorporate your suggestion.

peterska2 11-07-2005 07:04 PM

Quote:

Originally Posted by husain
peterska2, thanks for your detailed report. I really appreciate your efforts and patience. I would like to have your copy of the XML file. I can use that to fix my XML file. You can email the file to me at husainsfabbas AT hotmail.com

From your error report, is it safe to assume that all problems faced were because of poorly written SQL queries?

I'll just tidy it up a bit for you then get it uploaded.

Won't be long. :)

Here you go :)


All times are GMT. The time now is 12:52 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02113 seconds
  • Memory Usage 1,818KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (2)bbcode_php_printable
  • (14)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete