php - Growing a list of links from a query -


I have the following code, which will retrieve the file name from a table and will create a link for it. I want to, that's why, so I can mention $ files, tell later, and there will be an HTML code with links to many files that contain files.

I thought that would be the easiest way to do this in the previous variable, but it actually produces crap codes: 0test.sh "> test.sh

  if ($ GetFiles = $ con-> ready ($ filesQuery)) {$ getFiles-> gt; bind_param ("s", $ pk); $ getFiles- & gt; Execute (); $ getFiles- & gt; bind_result ($ FILENAME); $ Files = array (); while ($ getFiles-> fetch ()) {$ filename = array ('FILENAME' = & gt; $ FILENAME); $ files [] = $ filename;}} $ filesList = ''; Foreign Exchange ($ files as $ filenames) {$ filesList = $ filesList + '

What do I need to do, do not require an array?

You need to change that code to:

  $ FilesList = ''; Foreach ($ files as $ files) {$ filesList = '& lt; P & gt; & Lt; A href = "./ files / '$ Filenames [' FILENAME ']." & Gt; '. $$$ [FILENAME '] [& Lt; / A & gt; & Lt; / P & gt; \ N ";};  

Does this help? You can not insert from + .


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -