Questions tagged as 'foreach'

1
answer

Loop Doubt (For) with information coming from the database

What about personal blz? I'm having a big problem running my code. I have a web application made in laravel, which is running local. In this application I need to generate a report that is being done using DOMPDF. The report is incomple...
asked by 29.08.2018 / 16:06
1
answer

importing Xml data to Mysql database - only writes the LAST record

In this code all the XML records are read, but in the Mysql database only the last XML record block is written. I know that reading each record over-writes the previous one but the strange thing is that I gave an ECHO and checked that the foreac...
asked by 08.08.2018 / 17:19
1
answer

Create a foreach with a specific condition in PHP

I have this condition: if (date('Y-m-d', strtotime($arrayBancas['dataHora'])) == $data->format('Y-m-d')) And I also have an array. For each input of the array I need to check the condition and display the position data on the scr...
asked by 14.11.2014 / 02:48
1
answer

List and Count Rows of a Table in MySQL

I'm trying to make a listing of users who logged in and at the same time a count of how many times each user logged, from logins records in a table, I do not know how to explain very well, MySQL table (logins): Nome | Hora_de_Login ---------...
asked by 01.03.2018 / 21:24
1
answer

Foreach group values

I have the following code foreach ($_POST['codmunicipio'] as $key => $valor2) { $codmunicipio = $valor2; $valor_ipl3_f = $_POST['IPL3_valor_F']; $valor_ipl3_j = $_POST['IPL3_valor_J']; $sql3 = "INSERT INTO financei...
asked by 13.12.2017 / 18:33
1
answer

Error "Invalid argument supplied for foreach ()" and "Undefined index" in PHP form

I need to create 20 inputs which, when filled in, should show what was typed in them below, using arrays and foreach, here is the code below: function repeteInput(){ for($i = 1; $i <= 20; $i++){ echo '<form action="repeteInpu...
asked by 28.04.2017 / 16:01