• Resolved ucgf

    (@ucgf)


    Hi,

    I’m having trouble with data entry and default values – some of our columns in the database are ‘text DEFAULT NULL’ but blank fields in the data entry form are saved as an empty string.

    I have tried to set the default value to NULL on the data entry template as well, but that made no difference – still entered as an empty string. Have I missed a setting somewhere?

    Thanks!
    Una

    (I’m working with WP Data Access Premium 5.3.8)

Viewing 6 replies - 1 through 6 (of 6 total)
  • Leeberty

    (@aaronvincentlee)

    Hi @ucgf ,

    Thanks for the post!

    The database column needs to be allowed to have NULL values. You can check that in the structure/schema of your table.

    Can you please let us know what DBMS you are currently using?

    We’ll wait for your reply.

    Thread Starter ucgf

    (@ucgf)

    Hi,

    Yes the database columns are allowed to have NULL values, and the default is NULL. It’s a wordpress.com site and the DBMS is MySQL. I’ve been interacting with it through phpmyadmin version 5.2.1 and via WP Data Access. There’s no problem entering NULL in phpmyadmin.

    In addition, if I change the default to some random piece of text in phpmyadmin, or set the default to ‘none’, and then leave the field blank on the WP data access data entry form – it still appears as an empty string.

    I also have a problem with a boolean column…it might not be related but just in case. It appears as a tick box on the data entry form, but even when ‘ticked’ it is not recorded as true in the table – it reverts to NULL after saving. Other columns with data in them are appearing just fine – I’ll keep experimenting!

    Thanks, Una

    Plugin Contributor Kim L

    (@kimmyx)

    Hi @ucgf,

    Thanks for the response.

    Is there a page where we can test this data entry form?

    Namaste,

    We are also facing the same issue. When updating data from the data explorer of WP-data-access, it is taking blank value as an empty string and not as NULL. Due to this, it does not allow us to update the record.

    There are foreign Key constraints to avoid any empty Strings.

    Here is my question:
    How can we enter ‘NULL’ value using data explorer ?

    Thread Starter ucgf

    (@ucgf)

    Hi,

    I’m sorry for the long delay – we do still have this problem. I can’t easily share at the moment, unless you have a suggestion – the site is not public and the data entry isn’t on a front page.

    Thanks, Una

    Leeberty

    (@aaronvincentlee)

    Hi @ucgf ,

    Please feel free to send us a private message here https://wpdataaccess.com/contact/, so that we can assist you better.

    We’ll wait for your message. ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘NULL vs empty string’ is closed to new replies.