I had a perfectly working backend until server switch


#22

Managed to get this working but it still makes no sense at all

Had to go to every date field on the update and insert action and add a .default(“0000-00-00”)
Had to go to every number field on the update and insert action and add a .default(“0”)

I assume it is a server issue still because obviously this worked before???


#23

Im just brainstorming with you. I think it’s related to the date format of the hosting provider, if it’s in the US then it’s mm/dd/yyyy and maybe that caused an issue in your DB


#24

Maybe you are onto something because yes, i switched from a UK host to a US host, so that could quite possibly be what the issue is.
I wonder if there is a way for me to change that at the server level to be the format i want or not?


#25

you may use the date formatter function to override the date format


#26

Sorry just to confirm, are you meaning in Wappler using the data formatter or are you meaning at server level.
The issue is that I have to leave the date format at yyyy-MM-dd as there are already 80 000 records in the database in that format, so I can not change to mm-dd-yyyy
I would like to set it at WHM or cPanel server level rather to default to yyyy-mm-dd or in the MySQL server


#27

I believe MySQL by default is set to yyyy-mm-dd?


#28

Yes in Wappler.

I usually have this issue when hosted in US servers.

1- Create a field in SQL and take note of the format
2- In my code I convert the Date to dd/mm/yyyy to display
3- In case of Update and Insert I change the date format to mm/dd/yyyy


#29

Hmm, that sounds like there could be an issue, I really would not want to Update or Insert in mm/dd/yyyy even if i display the data as yyyy-mm-dd.
Also I think brad is right, because if i hover over the date field in phpMyAdmin it says acceptable range and that is in yyyy-mm-dd format?

I am trying to compare every screen i can from the old server to the new server in phpMyAdmin now just to check the defauls


#30

you have faced this before and its because you cant leave the fields blanks. set them to accept NULL
that is a must in the updated mySQL version
i am pretty sure it was you :sweat_smile:


#31

Does that not mean NULL? or are you meaning somewhere else.


#32

you are sending an empty string. witch is not the same as NULL or date


#33

you cant make the column varchar? try to remove the field from the post i guess?


#34

I understand but here is my issue, i have tried sending

{{$_POST.input}} which if empty sends ‘’ and does not work
{{$_POST.input.default(‘NULL’) which does not work
{{$_POST.input.default(‘0000-00-00’) is the only one that does seem to work


#35

have you tried to set the condition on the insert?
{{$_POST.input}}


#36

You are going to think I am stupid but no, because i have no clue how it works, i tried a few test but honestly have no clue what should go in there {{!$_POST.input == ‘NULL’}} is what i tried?


#37

put this maybe :sweat_smile:


#38

New server on the left, old server on the right


#39

Just tried that and the error comes back


#40

can i test the page?


#41

Will send you login details on a PM