Questions tagged as 'array'

2
answers

Group results with current date

Example, I have a query mysql like this SELECT * FROM post WHERE fecha >= $time; where $time = current week I also have a array with the days, which are grouped $days = array('Lunes', 'Martes', 'Miercoles',...
asked by 26.06.2017 / 16:14
1
answer

Value in particular within an array

I have a dilemma when printing a variable, you see, this is my query in SQL: SELECT MONTH(fecha_del_deposito) AS mes, SUM(importe) as monto FROM pago_cliente And it throws the following: Which happens to query in php: 'cantidadPa...
asked by 27.03.2018 / 20:04
1
answer

how to do push array inside an object that is in an array?

I'm trying to create a JSON and I need to do the following: var arreglo = []; var sumar = () => { var id = arreglo.length + 1; arreglo.push({id: id}); console.log('Arreglo', arreglo) }; sumar(); as Result prints: Arre...
asked by 18.08.2017 / 21:35
3
answers

Transform a multidimensional array, in a simple array

I'm trying to transform an array Integer[][] mapArray = new Integer[52][52]; for (int w = 0; w < 52; w++) { for (int x = 0; x < 52; x++) { mapArray[w][x] = -1; } } In a single-dimension array Inte...
asked by 30.01.2017 / 19:47
2
answers

How to fill a select dynamically, AngularJS?

I am filling out a selection of the departments of a company in the following way: $scope.selectize_a_data = { options: [ { id: 1,...
asked by 23.03.2017 / 06:44
2
answers

ES6 arrow functions traversing an array

question: How to show the elements of an array with arrow functions? I understand that given an array with elements, I pass the array as a parameter, but what I do not understand, is that it must go in the body of the function? Can this be...
asked by 11.03.2017 / 03:06
1
answer

How many positions do I have in an array?

I try to do the following ... class Nested { Persona[] Empresa; struct Persona { public string nombre; public string apellido1; public string apellido2; publi...
asked by 11.03.2018 / 16:32
2
answers

push array with php keys

Good morning. I am trying to create an array with values grouped by categories, by AJAX I receive two variables one contains a string with the name of the category and the other contains an array with the values of the category for example:...
asked by 18.08.2016 / 18:26
1
answer

Error compiling program in C ++

This is my program. I am using CodeBlocks. The errors that it shows me are the following: 26 - expected primary-expression before 'int'. 26 - expected ']' before 'int'. 26 - expected ')' before 'int'. 26 - expected initializer before '...
asked by 01.06.2016 / 10:41
2
answers

How to discard an empty array in a function?

Hello everyone I am working with native js, in this function I return the product of the elements in the array, what I can not achieve is to discard the case of an empty array, it always shows me the 1, but if it resulted in change the value to...
asked by 29.12.2017 / 09:41