Questions tagged as 'foreach'

1
answer

Foreach in Select and List

I recently discovered that there is a big difference between doing some operations, such as Select and Where , in Queryable and enumerated objects, such as Enumerable and List . This and this question. Kno...
asked by 20.05.2016 / 21:17
1
answer

Create columns with the foreach of knockoutJS

Good afternoon, I wanted to 'break' a list of items in 3 columns of 4 items in a foreach of knockoutJS. That is, at this point the list is populated down and I would like it to be broken via jQuery or javascript because CSS is not supported i...
asked by 22.03.2016 / 18:42
1
answer

foreach shows 1 file waiting then clears and shows another php

I have foreach in PHP and it shows several data of XML , but in this XML has 5 photos and I would like the loop to show the first photo, wait for 10 seconds and then show second photo so on. Here is the code I have:...
asked by 16.07.2015 / 19:27
1
answer

PHP Using SESSION with Array

Good night, my goal is when to go back to the products page, and go back to the cart, holding the session variable and also fill the cart page with more products each time the array receives a new one as it is generating one product only. Thank y...
asked by 12.03.2015 / 00:15
1
answer

Subcategory listing according to selected category

I have the following code snippet: <?php foreach($categorias as $cat){ $id_cat = $cat['id']; $subcategorias = array(); $sqlsub = Comando::Executar("SELECT * FROM subcategoria WHERE cat_pai = '$id_cat' ");...
asked by 02.02.2015 / 22:26
1
answer

Array inside Array

Good evening, I'm consuming a webservice and I get the data in json with cURL. I have the data stored in the variable $ data. What I need is the following: Let's suppose that in the $ data variable you have the following data: $data = [...
asked by 01.08.2018 / 04:28
1
answer

Problem with FOREACH PHP

My problem is that my foreach only works when in return in XML, it comes with more than one value in the array, but when it only comes 1, it does not work. The XML return when more than 1 value comes in: <NewDataSet> <HSONLINE>...
asked by 03.11.2017 / 21:56
0
answers

Get value in the forEach of JSP in JQuery to display in label

I would like help getting a value that is set within a forEach in my JSP, playing into Jquery and displaying it on a label on the same page. This forEach retrieves a direct list from the database. I used hidden to...
asked by 10.08.2017 / 07:00
1
answer

Calculating in foreach php with jquery

I would like to know if it is possible to run a real-time calculation with jquery inside a php foreach and how? This is my code: <?php $Read = new Read; $Read->ExeRead("c100web", "WHERE codclient = :client", "clie...
asked by 22.06.2017 / 21:36
0
answers

simplexml_load_file does not return any records

I have the following routine for reading XML file: $arquivo_geral = "xml_categ_1.xml"; if (file_exists($arquivo_geral)) { $xml = simplexml_load_file($arquivo_geral); foreach($xml->categoria as $categoria):...
asked by 18.07.2017 / 19:16