Skip to content

Tag: php

My SQL request work in SQL but not in PHP

I’m trying to make an unique request to insert multiple element in my database to not make multiple request. Here is my “generated” request, which work in SQL (tested in PHPMYADMIN). Generated by this code. But I get this error in PHP Do you know why this request does not work when I try to …

PHP Group Array By result of function on value

I have an array that’s basically a simple collection of objects. So [obj1,obj2,obj3] All instances of the same class. I then want to perform a map or filter to group these by a value in those objects. And what I want is a result like this, where all the objects are sorted by their user ids: Looking for …

how to excute duplicate key update in laravel

I want to duplicate key update it, but it doesn’t work. How to Duplicate key update in laravel? … in laravel .. Answer Follow this method to update your information in case key already exist. You must need to match unique data and update the rest.