Azure – add line on existing array with custom value
I need some improvements for the array, I want to add on an Array an extra Line with custom value like the sum for the costs... The way I did, is not the best way, can someone help me? $subs…
I need some improvements for the array, I want to add on an Array an extra Line with custom value like the sum for the costs... The way I did, is not the best way, can someone help me? $subs…
I have a table that I am reading two columns from using PDO::FETCH_KEY_PAIR. I then need check if a value from another query exists in the array returned by the PDO fetch. To illustrate: $id = array(); /* array returned…
DB::table('visitors') ->join('event_visitor', 'visitors.id', '=', 'event_visitor.visitor_id')->where('sex', 0) ->where('event_visitor.event_id', 1) ->count(); this is the query to get the count of men at the visitor's table with an event id of 1 I want to get the record count of men women and…
foreach ($events_id as $id) { $vis = $visitors->where('event_id', $id); array_push($men, $vis->where('sex', 'male')->count()); array_push($women, $vis->where('sex', 'female')->count()); array_push($kids, $vis->where('sex', 'kids')->count()); } I have a collection of visitors and events IDs I want to check how many men - women - kids are…
hello how can i compare two arrays one from my data json and the second from a array ? i need to know if the ids of "cm:taggable" exist in my secondArray JSON { "entry": { "isFile": true, "createdByUser": {…
I swear I tried everything I could but with no success, I read every answer in the whole platform but I can't get rid of duplicates (or loop repetitions) My tables are: items item_id (primary, AI, unique), it_title, etc. (the…
I am trying to make a script which Gets the current URL (url1 variable in the example) which contains params/values and which can be entirely different each time - OK I extract both params and values and create an object…
I'm starting to learn Aggregate in MongoDB. I have a simple doc as below, which has 2 fields, name and examScores. examScores is an array containing multiple documents: [ { _id: ObjectId("633199db009be219a43ae426"), name: 'Max', examScores: [ { difficulty: 4, score:…
I am creating a php email form with a foreach loop which creates a checkbox with several other checkboxes and input fields within the foreach loop. The loop might repeat several times, creating several sets of checkboxes, however I only…
So what I want to do is group all documents having same hash whose count is more than 1 and only keep the oldest record according to startDate My db structure is as follows: [{ "_id": "82bacef1915f4a75e6a18406", "Hash": "cdb3d507734383260b1d26bd3edcdfac", "duration":…