Questions tagged as 'array'

2
answers

for () is showing the same value as the array

Good afternoon, I'm trying to make a for () that shows the values for the current category. I use a function that takes the company and the category and selects the amount of records to display. Soon after, I use a similar function to show the p...
asked by 12.04.2016 / 20:07
2
answers

Array permutation

Ladies and gentlemen, I would like to generate an anagram of possible combinations. Ex: "123456" would generate: 1234 2341 6531 5431 1243 1342 or 12 43 56 23 14 16, whether or not repeated,  and so on, I know how to get the number of combination...
asked by 04.05.2016 / 18:15
3
answers

Join two bank array and exclude repeated values

I need urgent help, I'm doing a query in the database in several different array. When information "implode" and get caught again with "explode", however, I get repeated values and I wanted the same function as "SELECT DISTINCT". Does anyone kno...
asked by 26.01.2018 / 16:11
1
answer

Select Rows from a DataGrid and send to an Array

I have an application in WPF where I have a DataGrid with various information. I would like the user to be able to choose multiple rows and store the row information in an array (or not) so I can send it to another screen and play in an...
asked by 09.06.2015 / 17:30
2
answers

print the lines according to the array

How to print this array of my files this way:    NAME | PHONE | EMAIL | FAVORITE BIRTHDAY | DESCRIPTION I can only print by columns follow the code <!DOCTYPE html> <?php session_start(); ?> <html lang="pt-br">...
asked by 23.08.2015 / 03:25
2
answers

I can not register a person's name in my calendar

I am making a very simple agenda, the numbers I have managed to castrate however the names of the people I could not. My code #include <stdio.h> #include <malloc.h> #define MAX 50 typedef struct { int numero[MAX]; char nom...
asked by 29.06.2018 / 18:57
2
answers

Manipulating array values in PHP [closed]

I am storing an array in a session, but I am not able to manipulate it. How do I add all the array values? I tried this way: $item = $_SESSION['item']; $total = 0; foreach($item as $x) { $total += $x; } echo $total; exit(); however,...
asked by 03.11.2017 / 14:25
1
answer

Foreach repeating the same content

Scenery I have a form and via POST submitting to the page preview.php 10 song names that are divided between 4 arrays. I can generate the 10 divs containing the position array but when I create foreach for the artist I have a...
asked by 16.09.2014 / 19:08
2
answers

Manipulate non-existent variables in the array

How to mount the following array if one of the variables is not defined? $a = 1; $b = 2; $d = 4; $array = array($a, $b, $c, $d); The values of the variables ($ a, $ b, $ c, and $ d) come from a server and often do not contain any va...
asked by 18.04.2014 / 00:46
4
answers

How to put a loop of DB columns inside an array? [closed]

I have a database with dynamic columns that can one hour appear, another time not ... also more columns can be added or even extracted ones that already exist. I made a code that allows me to capture these columns in my database in real time...
asked by 26.12.2014 / 20:43