MySQL Connector

This section is for posting questions which are not directly related to WYSIWYG Web Builder.
Examples of off topics: web server configuration, hosting, programming related questions, third party scripts.

Note that these questions will generally not be answered by the administrators of this forum.
Post Reply
starran
 
 
Posts: 6
Joined: Fri Feb 15, 2019 7:08 pm

MySQL Connector

Post by starran » Mon Feb 18, 2019 8:10 pm

Hi

I know Extensions are not supported but I wonder if anyone has come up against this problem. I’ve been trying to create a form using the MySQL Connector, I’m able to navigate and delete records using buttons and Java Script as instructed in the documentation but when trying to create a new record it forces -1 into the primary key field even though that field in the MySQL database is set AUTO_INCREMENT. It will allow me to manually enter a unique primary key, complete other entries and then save succesfully. It just won’t automatically incement, but works fine apart from that Any ideas where I’m going wrong?

Stan

User avatar
Pablo
 
Posts: 15904
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: MySQL Connector

Post by Pablo » Mon Feb 18, 2019 9:20 pm

Are you sure the primary key in the database has been setup correctly?

starran
 
 
Posts: 6
Joined: Fri Feb 15, 2019 7:08 pm

Re: MySQL Connector

Post by starran » Tue Feb 19, 2019 12:55 pm

Hi Pablo

I think so, this is the table creation script.
CREATE TABLE inventory
( id INT(10) NOT NULL AUTO_INCREMENT,
customer_id INT(10) NOT NULL,
serial_number VARCHAR(30) NOT NULL,
description VARCHAR(30),
category VARCHAR(30),
wll VARCHAR(30),
hol VARCHAR(30),
PRIMARY KEY (id)
);

I've tried recreating the table, page and MySQL Connector settings from scratch but problem still persists. If I create id manually and set the id as a positive figure Save says “Record Saved” but it’s not when checking via phpMyAdmin, it will only save minus figures, i.e. -1, -2, -10 etc. So maybe I'm getting a little lost.

User avatar
Pablo
 
Posts: 15904
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: MySQL Connector

Post by Pablo » Tue Feb 19, 2019 1:34 pm

I'm sorry, I cannot think of another reason why it does not work.

starran
 
 
Posts: 6
Joined: Fri Feb 15, 2019 7:08 pm

Re: MySQL Connector

Post by starran » Tue Feb 19, 2019 6:57 pm

No problem, it's obviously something I’m doing or have done wrong, I’m sure I’ll sort it.
WYSIWYG Web Builder is brilliant by the way.

Cheers
Stan

starran
 
 
Posts: 6
Joined: Fri Feb 15, 2019 7:08 pm

Re: MySQL Connector

Post by starran » Wed Feb 20, 2019 4:32 pm

Resolved problem, I had included the id field in an Editbox on the form, doh. Once I removed it works fine :)

Post Reply