Hello I’m getting the following error PDOException: SQLSTATE[22007]: 1292 Incorrect datetime value ‘2022-03-07T18:08:12.000000Z’ for column ‘created_timestamp’ at row 1 in /[path]/[to]/[project]/vendor/laravel/framework.src.Illuminate/Database/Connection.php:496 That looks like a…
Dont print empty json arrays in php
Im programming a website where I can query server details from a game server. The problem is, that Ark sometimes prints empty playernames. That happens because there connecting at this moment or because they’re bots. I dont want to show them on my website. The problem is, that i don’t know how to …
Array to tree structure with no Id just string as keys (is this possible?)
I’ve been failing (my whole day) in getting this structure formatted as a tree to present in this format, see picture attached. as this has not parent and child the names of the key values strings like pattern_type_name act like parents and pattern_name are the child and under pattern_name are the marke…
Hide item from array
I am showing the product categories on the WooCommerce thank you page using this piece of code: The code above shows all categories, but I need to hide a specific category. Is it possible to hide a specific category by ID in the above code? Answer Woocommerce uses main get_categories() function from WordPress…
Retain Two Dependent Dropdowns selected values after form submit or page refresh
I want to have my two dependent dropdowns selected options to stay selected after client submit/refresh page. 1- I want my validation to be Client-side not Server-side. 2- I have my dropdown values in an array using a Script not with HTML Select and Option Tags + PhP method. 3- I currently achieved making dro…
laravel8 sanctum “Unauthenticated” when access any route under “auth:sanctum” middleware in server
I’m using sanctum for api, and all api run fine in localhost, but when run api in live server token doesn’t work, any route under “auth:sanctum” middleware redirect me to “Unauthenticated”, although i loged in, it loged in successfully and generate token, I passed “to…
Http failure response for https://localhost/***/api/get**.php?TOKEN=???: 0 Unknown Error
I’m working on a new app for my businnes and I need to convert my php web app to a mobile app. I’m having issues while trying to get the json data from my php file which is : I’ve been testing httpclient in my ts file with https://jsonplaceholder.typicode.com/todos/1 and it was working. Here…
Token for preventing CSRF attacks not validating
I am trying to add a token to my forms in order to prevent CSRF attacks But the token validation isn’t working Here is the input field which holds the token And here is the token validation code It doesn’t work and it returns the error message in the if block Answer I presume that the submitted au…
php table update multiple records at one time
I have a table that retrieves the username and availability status from the users table. Right now in my testing database I have 3 records. If I try to change the availability field for any of them, noting in updated. This is my availability.php file (the first line keeps getting cut off): Here is my av_updat…
Updating spreadsheet data with Google Spreadsheet api and php suddenly not working with authentication error
In a form which takes input and updates the value in a spreadsheet. It was working fine before but suddenly stopped working with this error message: According to other questions and answers it is because of authentication problem, but the form was working for 5 years with the same authentication so it is conf…