We have a huge database where users can create custom fields. Every UTF-8 character is allowed in their name. Until a few weeks ago, when they export their data in XML, only invalid characters that …
Tag: php
sql query selecting birthday today from number format
Let say i have identification card number in this format we can convert the number to birthday by using this code how do i select all user that is having birthday today ? is this possible ? Answer What I understand is first 6 digits of your ic is YYMMDD. If this is not the case please ignore. Accordingly you
Add Timestamp while insertMany() in mongoDB
Hi I am MySQL user and new to mongoDB. I get data from my IOT devices as following: I am inserting it into mongoDB using PHP CodeIgnitor as following: data is getting inserted in collection named as given key as following: Now I want to add timestamp to every row getting inserted. I want data getting inserted…
Square Payment Gateway integration in PHP website doesn’t redirect to payment portal
I m trying Square payment gateway using the API code found in the below URL [http://significanttechno.com/square-payment-gateway-integration-using-php] However, although i have replicated and tried to test the same code in my server, nothing seems to work. The form doesn’t allow me to input card details…
How to handle “unsupported_grant_type” from laravel passport
I’m playing around with laravel and try to enable client credentials grant to secure some api endpoints. To provide some context: I want to create an api that stands between a database and several websites (and SPAs). So I’ll be able to do some monitoring (what website/SPA calls which ressources) …
PHP preg_replace: Replace All Hyphens in String That Appear Before the Last Hyphen w/ Space
Using preg_replace (or other PHP-based option): I need to replace all hyphens in a string, that appear before the last hyphen, with space. Example #1 of the Result I Need: string = My-Cool-String – …
PHP – remove duplicate indexes from array, compared by one of it values
I have a PHP array with indexes, its values can be duplicated. I want to remove all duplicated indexes from this array: So, Index 1 and 2 with the same title “Title B” are duplicated. Only the one with the higher tstamp should be exists, all older ones with same title should be removed from array:…
illegal string offset in php array with odbc/db2 query
I’m running this function which is selecting data and I”m having it thrown into another function for inserting but upon errors and doing a var_dump of my results (which successfully dumped an array) I’…
Invalid credentials adldap2/adldap2-laravel package
I am implementing LDAP authentication in laravel app. When I run this code I am getting an error. I don’t know whether it is correct or not. I am totally new to LDAP and I don’t know how it works by …
MySQL syntax for summing several count data
I have a MySQL table called things_they_own with two columns: person and thing and my primary key is the combination of the two. Thus, there are several rows where the first column is a certain …