I use Laravel 9 and the built-in method Http::withHeaders ($headers)->post($url, $data). In the $data variable, I pass the string that resulted from http_build_request with the “&” separator. But Laravel tries to make an array out of it and send data. The API service returns me an error. Pl…
Tag: php
How to check if predefined selected column is null is laravel
I have this code : I want to check if correctTime is null then dont show this data. I have tried ->whereNotNull(‘correctTime’) it is giving error say column not found. Answer Since its a derived column you have to use having clause, the best thing of the raw query is that you can use multiple t…
Symfony 5.4.9 Composer detected issues in your platform:
I am totally new to Symfony. After I installed Symfony on my local ddev machine, I get this error I tried to composer install –ignore-platform-reqs as well, and soon as I run it, I get this error message My php version is Compose.json Thanks for help Answer Edit these 2 things in your composer.json to s…
Prestashop – Add multiple categories to a product
I’m trying to add more categories in my product but once created, the product keeps only the id_cetegory_default. My code : Result : Thanks in advance! Answer You need to call updateCategories function to add product into multiple categories. So once your product get saved; you can call this funtion. Fo…
Resolve name by ID in from 2 tables in PHP / SQL in Datatable
I am currently working on my first datatable which I managed to get to work and I am quite happy with it, however I am having some difficulties in resolving client names. Here is my current code: Tablefile.html: And here my datatable.php file: The table renders fine and works great, however client_id is obvio…
File Upload form using php
i’m working on app that takes a shot from the camera and upload the picture to the server so this is my code:- and upload.php :- the problem is that this upload script is uploading the picture but its corrupted file with size of 0mb so how can i fix this problem Answer Some problems with your code……
Laravel eloquent creating a WHERE condition if and only if the table column has a specific value
I am not sure if this is possible with Laravel eloquent, but I want to create an eloquent where the where condition would be based on the value of the current table column. Something like this for illustration purposes: column_a is part of the table column that I want to use. I could create 2 separate eloquen…
IlluminateDatabaseQueryException could not find driver Laravel
I deploy a laravel project on an apache server on a Debian 10 machine. The database is an MySQL deployed on another debian 10 machine on the same network. I can go to the connection interface of the application but when I connect this error appears : I have already tried these commands : these commands work b…
inline keyboard on telegram error 400 bad request
I wanna send a json encoded keyboard as reply markup but I get error 400 bad requset! This is how json looks like: and this is how the code looks like: I’ve also tried deleting one of the [ ] but it didn’t work. Answer I actually find the problem. It was a problem with data size. As Telegram says,
How to display message in HTML Tag with PHP in a function
I have this PHP form validator that is also hooked up to a mail function and to keep things organized I did the form validation in a separate function that is being called when the form is submitted. Now I have this problem that I don’t know how to display the error message when a field is empty in the