Welcome to the nuBuilder Forums!

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

Can not insert/add new record in forms

Questions related to using nuBuilder Forte.
Post Reply
akhlaq58
Posts: 2
Joined: Thu Apr 11, 2019 6:33 pm

Can not insert/add new record in forms

Unread post by akhlaq58 »

Hi I am new to nuBuilder. I have followed steps in nuBuilder user guide to create 2 forms. All records shown in search screen. I click add button which show me edit screen with empty fields. I fill the values and press Save button. It shows the "record saved" indication but it actually not saved. Not shown in search screen even after using refresh button. However if I edit any record, it saves successfully. I given full privileges to globeadmin user in mysql using phpmyadmin. What am I missing? I am using latest version nubuilder4-master on windows 10.
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: Can not insert/add new record in forms

Unread post by kev1n »

Do you see any error messages in the debug log?
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: Can not insert/add new record in forms

Unread post by kev1n »

akhlaq58
Posts: 2
Joined: Thu Apr 11, 2019 6:33 pm

Re: Can not insert/add new record in forms

Unread post by akhlaq58 »

Hi Kevin! I checked the logs. Mostly it was showing the ID field was twice in "Insert into" statement. So I change the form structure and removed ID field. But still it shows some other error which I could not understand. Here is the log of error.
[0] : ===USER========== globeadmin ===PDO MESSAGE===
SQLSTATE[01000]: Warning: 1265 Data truncated for column 'ID' at row 1
===SQL===========
INSERT INTO students (ID, `Name`) VALUES ('5d42e31315d2646', 'Gohar');
===BACK TRACE====
C:\wamp64\www\nubuilder4-master\nudata.php - line 348 (nuRunQuery)
C:\wamp64\www\nubuilder4-master\nuapi.php - line 52 (nuUpdateDatabase)

Is there any good tutorial to follow to design the forms correctly. Specially the form with subform.
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: Can not insert/add new record in forms

Unread post by kev1n »

The ID column should be of type varchar(25).
Post Reply