I don’t understand how to use nested loops(for, foreach,while,dowhile) for printing this multi-dimensional array values in separate lines. I am new in this sector. Here is the code: Answer you have associative array inside associative array You have to loop the first associative array and inside it loop…
Tag: loops
How to out of while and for loop combined
I am trying to write a code that is capturing number 3. using while loop as the condition, so that the for statement will be the evaluation condition of $x, of the while loop statement, and by the same time, using if statement to evaluate the value of $x=3 and so it can echo ‘three..’; . please en…
Loop through associative array resulting from mysqli_fetch_assoc
I am new in the web development family and I really need help on that problem. The requirement is to get a list of video with their tags. I have 3 tables in the DB – one for videos, one for tags, and one intermediate table video_tags. Here is my query to get datas from DB tables in order to
Update MySQL Database With Data From Multiple Input Elements Inside A While Loop, And A Single Submit Button Outside of The While Loop
I have a page that fetches images from a database after an initial upload, that allows the user to add titles and tags to the images. I have set the while loop to output the individual images inside one form. Each image has two related input fields. What I would like to do is have it so when the form
php loop and tag to go to another page [closed]
Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 6 months ago. Improve this question Hi I…
PHP with Loop Calculation [closed]
Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed last year. Improve this question Can som…
PHP echo/print value on for every 4th loop (start of count is 0)
How do i echo a value for each certain loop (4th) if my starting count number is 0? For example, the count is 0,1,2,3,4,6,7,8,9,10,11,12,13 I need it to echo/print on the following numbers: 3,8,12,16 Here’s my loop codes: It kind of works but unfortunately, it starts printing the $VALUE on #0 So it prin…
Get the first element in a for loop with php [closed]
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed las…
Increasing the conditions in IF statement with loop PHP, Diagonal Check
I have homework to do this program in PHP, that take a matrix and the keywords, so it can find them in the matrix diagonally: So this is how the first matrix looks, there are many with different keywords, here for instance keywords are “beef” and “pork”. So I made a program for an inpu…
How to get multiple values through session from a file which is running multiple times in PHP
I have a file which is run 2 to 3 times and there is a variable $student_name, and I want that variable to be available in another file. How to achieve it? file 1. file 2. but I am getting only the last assigned value. Answer If file 1 is executed 3 times, then $info will be re-created empty in