Questions tagged as 'while'

2
answers

PHP: Take value of an arrangement inside a while and send it to another page

I have a problem. I need help to traverse a while and take the value of an array that is full of data from a database. I need to take some value and send the data of that arrangement to another page. I leave my code here: <?php while($ro...
asked by 01.08.2018 / 18:17
4
answers

PHP mysql_fetch_array

I'm trying to show results from my database, I did not know how until I saw this way of doing while($row=mysql_fetch_array($result) { //Code } and then I saw that using this form is somewhat obsolete, so I would have to choose to use...
asked by 23.06.2017 / 23:13
5
answers

Restart while while JavaScript

I have been testing some things in JavaScript and, since I am learning, in practice I have encountered an error executing a cycle while() that I describe next. What I need is to make a prompt() that asks for a password to...
asked by 08.08.2018 / 06:10
2
answers

Why does not the while function?

I have to make a program and it does not work for me, the main problem is with the average, if I put it in while it prints me that it gives all zero, and I put it outside the while I jump error    ("Exception in thread" main "java.lang...
asked by 21.08.2018 / 01:59
2
answers

Problem with the while loop in JAva

I try to execute a very simple code, I simply want the program to ask the user to enter their hobbies until the user enters 'done'. Then, the program goes to the next part. The problem appears when I enter 'done' but the loop continues. import...
asked by 17.07.2018 / 18:32
1
answer

Guess number with Java with while loop and with attempts

I have done this program with Java, that the user has to guess the number with 5 attempts, the number is 6, but the second attempt hangs up import java.util.Scanner; public class Practica15 { public static final int NUMERO_SECRETO = 6;...
asked by 17.10.2017 / 09:40
1
answer

restart the loop

Hello, I am creating a game that I have as an exercise, it is to guess the number. The program works perfectly for me, but I need at the end of the game to ask if I want to play another game or not, that is, to come to the beginning of the loop....
asked by 18.10.2018 / 11:07
3
answers

How to look up value in an array without a cycle

I do not have much experience in c ++ and I have the following question: I have an array / vector of N elements, and I have to enter it into a while condition to check if any of its elements equals a constant number k, but the idea is that every...
asked by 13.10.2018 / 01:19
1
answer

Assign results from a WHILE to a Variable

guys, I have the following case: I have the following code: $sql ="SELECT * FROM monto LIMIT $limite_base, $l "; $resultadosql = mysqli_query($db, $sql); while ($rowsql=mysqli_fetch_row($resultadosql)){ printf ("%s\nBsS\n", $rowsql[1]); $...
asked by 28.10.2018 / 08:56
1
answer

Array only prints last record

I have the following structure. global.php <?php define("DB_HOST","localhost"); define("DB_NAME", "prueba"); define("DB_USERNAME", "root"); define("DB_PASSWORD", ""); define("DB_ENCODE","utf8"); ?> conexion.php <?php require...
asked by 30.01.2018 / 14:32