close
Skip to main content

New answers tagged

Score of 2

How to put many different mysqli_query into the same array with a for loop

I could solve it. I had to start $i in the second for loop with 0 AND the condition had to be changed to $i < $number[0] as the first index of the referenced $sql_command[] is 0. That was the ...
Score of 5

How to put many different mysqli_query into the same array with a for loop

It looks like a design error. Instead of using a loop with ... WHERE vsz_id=$i ... you can use without loop ... WHERE vsz_id between 0 and $number[0] ... If you have an array named $wanted with an ...
Score of 0

Which is the better way to calculate the size of one array in a for statement?

The generally recommended practice is that you get the count once and store it in a variable before the start of the loop (the first section of for loop). This prevents "extended" looping by ...
Score of 0

What's wrong with my code for checking whether a number is prime?

You need to break when the number fails like: user_input = input("pick a number ") user_input = int(user_input) # make it a number for i in range(2, user_input): # stops at user_input-1 ...

Top 50 recent answers are included