Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

my FastForm builder seems to be dropping tables...

Questions related to using nuBuilder Forte.
lxnunes
Posts: 22
Joined: Sat Dec 18, 2021 1:40 am
Has thanked: 2 times

Re: my FastForm builder seems to be dropping tables...

Unread post by lxnunes »

please disregard the last comment about the DATABASE() function. It seems to be a no-issue based on lack of caffeine :|

FYI, this query (and a variation using upper case) seems to exist also in these locations of nucommon.php

Code: Select all

Line 1192: $t	= nuRunQuery("SELECT table_name as TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = DATABASE()");
Line 1210: $t	= nuRunQuery("SELECT table_name as TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'VIEW' AND table_schema = DATABASE()");
Line 1256: $t	= nuRunQuery("SELECT table_name FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = DATABASE()");
And I see another error in nuDebug (low impact), probably because MySQL does not accept casts as INTs, just as UNSIGNED. MariaDB reportedly has no issues with this syntax:

Code: Select all

===PDO MESSAGE=== 

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INT)) + 1
		FROM `zzzzsys_form` 
			WHERE `sfo_code` LIKE 'FF%'
			AND SUBSTRING' at line 2

===SQL=========== 
		SELECT 
			MAX(CAST(SUBSTRING(`sfo_code`, 3) as INT)) + 1
		FROM `zzzzsys_form` 
			WHERE `sfo_code` LIKE 'FF%'
			AND SUBSTRING(`sfo_code`, 3) REGEXP '^-?[0-9]+$'

===BACK TRACE====
/var/www/html/TestDB/core/nubuilders.php - line 116 (nuRunQuery)
/var/www/html/TestDB/core/nubuilders.php - line 26 (nuFFNumber)
/var/www/html/TestDB/core/nucommon.php(1349) : eval()'d code - line 1 (nuBuildFastForm)
/var/www/html/TestDB/core/nucommon.php - line 1349 (eval)
/var/www/html/TestDB/core/nucommon.php - line 437 (nuEval)
/var/www/html/TestDB/core/nuapi.php - line 81 (nuRunPHPHidden)
kev1n
nuBuilder Team
Posts: 4416
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 74 times
Been thanked: 472 times
Contact:

Re: my FastForm builder seems to be dropping tables...

Unread post by kev1n »

I'm wondering what MySQL version you running?

The SQL with the INT cast works just fine newer mySQL/MariaDB Versions
Eventually I tested it on MySQL 5.7 where I could replicate the "Syntax error or access violation".
Casting to UNSIGNED instead of INT fixed it for me.

Can you try it with this new version (Just replace your local nubuilders.php with the one from Github)
https://github.com/nuBuilder/nuBuilder- ... ilders.php
lxnunes
Posts: 22
Joined: Sat Dec 18, 2021 1:40 am
Has thanked: 2 times

Re: my FastForm builder seems to be dropping tables...

Unread post by lxnunes »

kev1n, I cannot thank you enough for your help, that version works as expected.
I am running

Code: Select all

Ver 8.0.27-0ubuntu0.20.04.1 for Linux on x86_64 ((Ubuntu))
kev1n
nuBuilder Team
Posts: 4416
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 74 times
Been thanked: 472 times
Contact:

Re: my FastForm builder seems to be dropping tables...

Unread post by kev1n »

I am glad to hear that everything is working now :D

What MySQL version is returned if you run this command in phpMyAdmin?

Code: Select all

SELECT VERSION();
lxnunes
Posts: 22
Joined: Sat Dec 18, 2021 1:40 am
Has thanked: 2 times

Re: my FastForm builder seems to be dropping tables...

Unread post by lxnunes »

fortunately, the same

Code: Select all

+-------------------------+
| VERSION()               |
+-------------------------+
| 8.0.27-0ubuntu0.20.04.1 |
+-------------------------+
Post Reply