whats is the best/fastest way to upload images from android to mysql? the problem that im having that uploading images encoded in base46 that it takes almost 10sec and after 3 or 4 uploads using bitmap the app crashes sometimes because bitmap other because of the encoded images on old android phone.. right no…
Error on input validation even though input exists
I have an application where an user can change his name via a pop-up. This is the method that handles the name change: This is the blade file with the modal: The issue is when I have the required in the request validation I always get the error, when I delete the required everything works perfectly. I need it…
Updating stocks quantity in Product Table from Cart
Hello everyone so basically I have this 2 tables ProductLists and Cart Note: Cart table contains temporary datas inside it, if the orders inside cart table are already paid the table itself will truncate. I tried running this query and this happened output any advice on how to do this without making the stock…
Get bitwise and of all elements of an array in php
if i have and array like and i want to do a bitwise add operator for all elements like What will be the logic and how to do it ? Answer This can be achieved with the following one-liner: It uses array_reduce to ‘loop’ over the array, reducing it to one value. The callback function performs the bit…
When I pass string variables to controller in laravel via ajax, It doesn’t show me proper data
This is my Ajax Query This is y Controller And this is the response I get, butI actually want the proper string value that I passed through ajax Answer actually, your script shows proper data what you asking for here your URL looks something like this. because you sending a string instead of a value what you …
what is nonce in the api client
I have a API client to make a PHP call. But as a matter of fact the documentation given with the API is very limited, so I don’t really know how to use it. This a part of the API code: I don’t know what is nonce and how does it works. Answer The NIST glossary defines a nonce as
how to convert this block of code into a php version
// Javascript program to check if all array elements are // same or not. // This code is contributed by patel2127 Answer Taking the information from the question previously dealt with here: Check if all values in array are the same I think your function would look like this: array_unique() returns the same ar…
php fatal error handler… failing with no error_get_last() set
I have been using a fatal_handler() function that I expanded on for over a year now but for some reason I now have random errors popping up in the error_log file on the server and triggering the notification. Previous to a little while ago it was working fine. The errors seem to come from the array $error whi…
WordPress two custom_post_type one taxonomy
I create two custom post_type. The name of the custom post is- 1. Brand 2. Ethical And I have created a taxonomy. The name of the taxonomy is – Pharma. The common taxonomy of the two custom posts is one (pharma). Now I want, on one page – 1. Just to display all the names of Pharma Taxonomy. 2. I
how to add data to validated request input bag
I need to add custom data to the request input array from my customRequest class I tried this way It’s do the trick with request()->all() but when I returned $request->validated() it’s not exist. how can I do it? Answer $request->validated() is returning only validated data (data in the r…