Questions tagged as 'foreach'

1
answer

Access data inside array in PHP

Hey guys, all right? I have a problem with a project I'm developing. I get a form where the user informs the data but in this form, it is possible that it clicks a button to insert new inputs and inform other data. The array I am using as...
asked by 24.09.2018 / 14:02
3
answers

How to check each character in an array? JavaScript

Person, I have this code: const arrayOne = ['jean','geleia','gean','ea games', 'e1']; function buscar(){ arrayOne.forEach(function(valor){ const teste1 = document.getElementById('valorInput').value; if(teste1 ===...
asked by 25.02.2018 / 17:57
3
answers

Send information from a Data grid Viwer to sql database [closed]

I am putting together an order form using C # . The problem is that when I try to send the products that are listed in the Data Grid Viewer to the database, the program reads only the line where the cursor is. I know I need a foreach...
asked by 24.04.2018 / 03:04
1
answer

How to move an array in the correct way

Good evening guys, I'm having a lot of trouble with arrays ... I have the following array: array(6) { [0]=> array(1) { ["cep"]=> array(2) { [0]=> string(8) "15070650" [1]=> string(8) "03216040...
asked by 07.09.2018 / 23:13
2
answers

Put two Arrays inside a foreach [closed]

Well, in the case I have two arrays that are received from inputs, based on hotel room rentals, in case each room needs to display Number of adults and children, I got someone's help here on the stack to increase the number of rooms, but I had t...
asked by 19.09.2017 / 03:44
1
answer

Registration in foreach php

Alright? I am trying to register several records in the bd according to the number of parcels requested, but I am not able to. My code: php: $Conn = parent::getConn(); try { foreach ($this->Data as $pr): $Query =...
asked by 03.07.2017 / 22:06
1
answer

Arrays in a single index

I've done this question today , helped me a lot, now I have the code: foreach ($tokens as $row) { $token1[] = $row['oauth_token']; $token2[] = $row['oauth_token_secret']; } var_dump($token1); var_dump($token2); And it returns me:...
asked by 25.07.2017 / 23:43
1
answer

Problem with foreach Shopping Cart

I'm having a problem with foreach and I wonder if there's another method to not have to change all the code. What happens is that each time more than one product is added to the cart, if we buy 2 products instead of getting everything...
asked by 09.07.2015 / 13:51
1
answer

JQuery - Tie inside a DIV

Hello, good morning. Simple: I'm giving a For a div: <div class="Laço"> <div class="ItemLaco"></div> <div class="ItemLaco"></div> <div class="ItemLaco"></div> </div> Now I need...
asked by 22.06.2015 / 07:34
1
answer

Mount an array with result of a foreach with php

Hello I'm not able to mount an array with results from a foreach. I have and foreach foreach($Result as $Aluno): extract($Aluno); echo '<tr>'; echo "<td class='nome'>{$Nome}</td>"; echo "<td class='c...
asked by 28.11.2018 / 21:25