vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   New Posting Features - Easy Forms v4.x - Create a form or multiple forms without php or html knowledge (https://vborg.vbsupport.ru/showthread.php?t=234385)

PPhysX 03-09-2020 11:00 AM

Code:

Database error in vBulletin 4.2.5:

Invalid SQL:
INSERT INTO formbits
                (fid, displayorder, type, question, description, options, compulsory, perrow, rows, cols, maxlength, ereg, custom, spacer, size, guestonly, minlength, reference, hidelabel, quiz)
                VALUES ('1', '10', '13', 'Test Scale', '', '', '1', '0', '1', '5', '0', '', '', '', '0', '0', '0', '', '0', '');

MySQL Error  : You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'rows, cols, maxlength, ereg, custom, spacer, size, guestonly, minlength, referen' at line 2
Error Number  : 1064


Any fix for this please?

shka 03-09-2020 12:55 PM

Updated your DB server?

Quote:

Originally Posted by PPhysX (Post 2602282)
Invalid SQL:
INSERT INTO formbits
(fid, displayorder, type, question, description, options, compulsory, perrow, rows, cols, maxlength, ereg, custom, spacer, size, guestonly, minlength, reference, hidelabel, quiz)
...

"Rows" is a reserved word in MariaDB since 10.2.4

Edit your forms.php and quote the column names with backticks `
, I found this three times
Line 1976
PHP Code:

(`fid`, `displayorder`, `type`, `question`, `description`, `options`, `compulsory`, `perrow`, `rows`, `cols`, `maxlength`, `ereg`, `custom`, `spacer`, `size`, `guestonly`, `minlength`, `reference`, `hidelabel`, `quiz`) 

Line 3305
PHP Code:

(`fid`, `displayorder`, `type`, `question`, `description`, `options`, `compulsory`, `rows`, `cols`, `maxlength`, `size`, `perrow`, `ereg`, `custom`, `guestonly`, `minlength`, `reference`, `hidelabel`) 

Line 3555
PHP Code:

(`fid`, `displayorder`, `type`, `question`, `description`, `options`, `compulsory`, `rows`, `cols`, `maxlength`, `size`, `perrow`, `ereg`, `custom`, `guestonly`, `minlength`, `reference`, `hidelabel`) 


PPhysX 03-09-2020 01:06 PM

Quote:

Originally Posted by shka (Post 2602285)
Updated your DB server?



"Rows" is a reserved word in MariaDB since 10.2.4

Edit your forms.php and quote the column names with backticks `
, I found this three times
Line 1976
PHP Code:

(`fid`, `displayorder`, `type`, `question`, `description`, `options`, `compulsory`, `perrow`, `rows`, `cols`, `maxlength`, `ereg`, `custom`, `spacer`, `size`, `guestonly`, `minlength`, `reference`, `hidelabel`, `quiz`) 

Line 3305
PHP Code:

(`fid`, `displayorder`, `type`, `question`, `description`, `options`, `compulsory`, `rows`, `cols`, `maxlength`, `size`, `perrow`, `ereg`, `custom`, `guestonly`, `minlength`, `reference`, `hidelabel`) 

Line 3555
PHP Code:

(`fid`, `displayorder`, `type`, `question`, `description`, `options`, `compulsory`, `rows`, `cols`, `maxlength`, `size`, `perrow`, `ereg`, `custom`, `guestonly`, `minlength`, `reference`, `hidelabel`) 


Thanks for the quick reply! I have gone ahead and tried this, and given it another try.
This time the error is as follows:

Code:

Database error in vBulletin 4.2.5:

Invalid SQL:
INSERT INTO formbits
                (`fid`, `displayorder`, `type`, `question`, `description`, `options`, `compulsory`, `perrow`, `rows`, `cols`, `maxlength`, `ereg`, `custom`, `spacer`, `size`, `guestonly`, `minlength`, `reference`, `hidelabel`, `quiz`)
                VALUES ('1', '10', '13', 'Test Scale', 'Test descr', '', '1', '0', '1', '5', '0', '', '', '', '0', '0', '0', '', '0', '');

MySQL Error  : Unknown column 'rows' in 'field list'
Error Number  : 1054


shka 03-10-2020 06:47 PM

It is only a MariaDB-reserved-word-problem with two possible reasons and solutions.

A. Install mod first and later upgrade MariaDB to 10.2.4+
Then you can check in phpmyadmin if there is a column "rows" in table formbits. If yes then backticks two posts above is the solution.
If no then B.

B. (like PPhysX) Install mod on MariaDB 10.2.4+
Then adding the "rows"-column fails in installer. Then it makes more sense to use a better column-name.
a. First goto phpmyadmin in forum-db
Call sql (same as installer but changed column to "textrows" for visible rows in textarea)
Code:

ALTER TABLE formbits ADD textrows int(5) NOT NULL default '3';
Then with sql "show fields from formbits" you shoud see a new line (= tablecolumn) called textrows

b. The go to forms.php and edit the three lines 1976,3305,3555. You can use old or new version (with or without backticks, but replace "rows" with "textrows").

c. Then edit some other lines (always replacing rows with textrows shown next)
Code:

line 2054
                        textrows = '". $vbulletin->db->escape_string($rows)."',
line 3401
                        'rows'          => $formbit['textrows'],
line 475
                        $formoutput .= $form['prea'] . ($qo[$formbit[id]] >= $formbit['textrows']  ...
line 521
                elseif (($qo[$formbit[id]] < $formbit['textrows'] OR ...
line 1611
                        $i = $formbit['textrows'];
line 2377
                        $starti = $formbit['textrows'];
line 3314
                                        '" . $vbulletin->db->escape_string($question['textrows']) . "',
line 3564
                                        '" . $vbulletin->db->escape_string($question['textrows']) . "',


PPhysX 03-11-2020 08:20 AM

Big thanks to 'shka', his solution worked and so far no errors whatsoever on 4.2.5

N0FeaR 10-30-2023 12:38 PM

Is there any plugin like this for vbulletin 5 ?

wolfe 11-12-2023 07:56 PM

I have my forms make threads and have stopped them saving to database so how do I delete old complete form entries ?


All times are GMT. The time now is 07:16 PM.

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.05756 seconds
  • Memory Usage 1,768KB
  • 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
  • (4)bbcode_code_printable
  • (6)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (3)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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