Hello there this is the code which fetch images from database with reference of ID which fetch only a single images and i want to fetch images one after one which can be done with foreach loop so help to convert this code in foreach loop
Let me exaplain i Am making a dashboard as i have specified earlier and i want to display images one after for every visitors and i think that it can be possible only with for each loop only so help me to convert this code into for each loop…
In this case you should remove the WHERE from the query, that will make one query select all the images, not just the one specified by the ID.
You may then iterate through the table rows using a while loop.
As you said i have removed the where and called it with while loop and not getting it so i request you to send me the full code with foreach loop as i am not getting it…
You do not make the query in the while loop. The while loop comes after the data has been pulled from the table, to iterate through the results.
This is very basic, standard use of sql in php, if you do not know how to do this, you really need to find a course or tutorial on the subject, preferably one using current methods rather than the obsolete mysql.
Though from what became apparent in your previous topic, perhaps you first need to learn html and get a firm basis in that before you even consider using php.
You seem to be mistaking the forums for a “free coding service”. This is a place where you will get help to learn how to code, not a place where people will do your work for you.