Questions tagged as 'bucle-for'

2
answers

How to subtract values in an array (PHP)?

First I generate an array of 3 positions with random numbers, then I try to subtract the three values from the array. The problem is that if the first subtraction gives me a negative number the next value does not subtract it well. For example:...
asked by 29.11.2018 / 12:44
2
answers

PHP color tables, rows and columns

How could I structure the following code adequately to achieve these results? I'm a bit lost with the PHP theme to "merge" with the html. If it is 4x4 it shows 16 numbers, the odd ones in green and the pairs in red. <html> <...
asked by 26.10.2018 / 14:17
2
answers

Character counter in input with PHP

Hello, I'm creating a script where the user is asked for an Input where he can put a word or phrase and that decreases the number of characters. pero me sale del todo bien <?php if(isset($_POST['enviar'])){ if(isset($_POST['texto'])){ $tex...
asked by 13.07.2018 / 01:20
1
answer

Infinite loop and problem with v-show in Vue.js

I'm doing a project in vue.js and I have two situations. The first is that I am generating a list (which is repeated twice) using a v-for , which works correctly, but in the console I get the following error:    [Vue warn]: You may ha...
asked by 30.07.2018 / 17:37
1
answer

Help for while php

I am needing help to do a while or for or a correct way to repeat content <?php mysqli_select_db($conexion, $database_conexion); $query_DatosCategorias = sprintf("SELECT * FROM categorias WHERE estado>0"); $DatosCategorias= mysqli_query...
asked by 30.06.2018 / 15:10
1
answer

How do I add a number to the results of a loop?

Hi, I have a decreasing while loop to which I have to add 3 each time I show an even number, but I can not get it added to me. What am I doing wrong? <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <ti...
asked by 04.08.2017 / 23:45
1
answer

For loop in python

Good morning, The value of x is a decrease of 1.0 - 0.01 asi, the first value of x=0.99 the second x=0.98 and the third x=0.97 The first value is x1=1.0 The problem is the update of x1 and t...
asked by 13.03.2017 / 19:19
1
answer

How to add strings correctly to a For loop in Java Netbeans?

I have a problem tracing the for loop in my program. In fact I do not know if based on the statement is doing the program correctly (if someone has another logic could help me). In the end the error is that I want to ask for the parameters clien...
asked by 03.11.2018 / 23:53
0
answers

Structure an HTML calendar created with For cycle that repeats dates obtained from MySQL

The following code corresponds to a For cycle that fills a calendar made with HTML (see the following image). In this case, the events obtained by dates from the DB are shown. Those dates are doubled and try to fix it with an if but it ju...
asked by 07.10.2018 / 06:05
1
answer

Android Studio error: java.lang.ArrayIndexOutOfBoundsException: length = 1; index = 1

I am having a problem that has been going on for hours and I can not solve it. The error that gives me when compiling the program is the title. This is my class: public class ElegirCuidados extends AppCompatActivity { private String elegir...
asked by 14.11.2018 / 16:39