I had a perfectly working backend until server switch

what’s that ! doing before $_POST?:roll_eyes:

Was trying to say if NOT $_POST.input has a value then it must = NULL, LOL, told you that condition stuff in there was confusing me badly.

I just tried again with the condition only set to {{$_POST.input}} and removed to value of {{$_POST.input.default(‘0000-00-00’)}} to just {{$_POST.input}} and now it works.

WHY??? Please try explain these damn conditions to me.

I found this

i never used it actually but it make sense

it will be like this:
if the condition is met (the POST is there) then set the value.

Still does not make sense to me, if the condition is met, means what, that there IS a value set or the value is MISSING, if missing then set the value to what NULL instead of empty.
Must be because this it the first time my database has ever had the date field actually show the word NULL rather than 0000-00-00

This is really frying my brain, haha

I suppose at least it is all working, so I am going to have to think about this more, but for now it works, thank goodness

Thanks to all for the assistance

means set the value that you put on the value field :slightly_smiling_face: otherwise don’t

But I have put nothing in the value, sorry I must be tired because I really do not get it.

This is what i have landed up with which now works perfectly

This is what i am trying to insert on the form, basically all black fields except for Date Captured, Title, Notes, Total Spend, all the rest are left empty

This is what it inserts like, which is what I always wanted

To make it even more confusing, this is when the update did not work and gave an error before setting the condition, here are the headers

And this is the displayed headers after setting the condition which then did work

what you have put on the server update action for the date is correct. if the field is available then use it or don’t submit it in the query witch will be NULL.
if the field is submitted even when you are leaving it blank on the form then your issue is there not on the server action.

1 Like

and when you debug switch to response tab. not the headers. i cant understand anything from the headers :sweat_smile:

Ahhh, i think i get it now, so basically entering a condition of $_POST.input means if I insert a value then send the value in the header information, but if i set no value in the $_POST.input then rather than sending ‘’ BLANK to the server in the header, just do not send anything for $_POST.input which will then make MySQL set the value that I set as the Default.

My goodness, thanks for sticking with me, now it does make perfect sense.

I was trying to show that both sets of headers were blank for the same fields, but honestly i now get it. Very very clever indeed.
You did it @mrbdrm, because I have not used or understood that for about 3 years now I am ashamed to say.

1 Like

Glad you understand it better (i hope :joy:)

2 Likes

Me too, until the next time I ask, haha, then you can swear at me and I will not flag you :rofl:

2 Likes

Well…this was an entertaining thread. I appreciate the entertainment. There’s some leftover popcorn if anyone wants any…

1 Like

haha haha haha, you like watching me in a total and utter state of confusion. LOL. I have a headache right now after this chat like you would not believe, LOL, 5 hours from when i began debugging this problem, and all I needed was to understand that silly condition area. Can hardly believe it took me this many years to understand that concept when I can understand concepts way more complex, that one just alluded my brain entirely.

Although I am so excited I understand now and am wondering all the different ways i could use that with other things i need to do. in the next few days I will be sending feature requests to extend it im sure.

1 Like

It can be frustrating for sure. I can’t see any of your screenshots (they are tiny on my screen for some reason.), so I couldn’t see what everyone was talking about. But do know, watching someone else get frustrated made everything in life seem better for a few seconds. :slight_smile:

I think code is a lot like guitar. If you pick up bad habits early or do things wrong early on, you might not realize they are a problem until you get much more advanced. Then you have to relearn some things again… Glad you got it figured out!

Sorry my screen res on that monitor is 3840 x 2160 as it is a 43" monitor, I will try make screenshots on the 27" in future, oops.
I thought there was a zoom tool on the screenshots too though.

That is the same resolution as my laptop. Strange they would be small. I think it is because when I tried to zoom, they would just click to the next photo. I wonder if there is a way to enable zooming of images on Discord? Even outside of our resolutions, that might be useful for people that have poorer eyesight.

EDIT: Also, I have Windows at 175% scaling, which makes my screen more like 1080. But even so, I could not zoom on them. THough it seems I recall being able to on other photos elsewhere on here. Maybe there is a trick to it. (Now I can be frustrated with something!)

1 Like

Hey guys,
That’s a long discussion here :slight_smile: glad you found the issue.

As a conclusion I’d like to add:

  • Date format in date field in myslq table is always an ISO date yyyy-mm-dd and it doesn’t matter if your server is located in USA, UK or Hong Kong.
  • The condition field is used to insert the data from the field (or not insert it) if the condition is met/not met, so when you don’t want to send empty strings - use conditions.
  • Date fields in the database do not accept empty strings as a value.
1 Like