php - Return the exact ID using fetch_assoc -


I have a small problem in my code and I need your help. Well fetch_assoc to get data from Im database And I need to get the id number of each returned value. The issue is that my code only returns the id number of the previous data here. Here is my code:

   Fit (PDF: FETCH_ASSOC)) {$ album_ID = $ line ['album_ID']; $ Value = $ line ['album_name']; Print "& lt; option value = ''. $ Value. '' '& Gt;" $ value. "& Lt; / Option & gt; "?}? & Gt; & lt; / select & gt; & lt; input type =" hidden "name =" album_ID "value =" & lt ;? Php print $ album_ID? I like the selected album id in the hidden input type, but it always keeps the album id of the previous data as it is. Please help.   

Your best bet is to give the option to the option option in the ID < / P>

  .... while ($ line = $ stmt -> Get (PDF :: FETCH_ASSOC)) $ {album_ID = $ line ['album_ID']; $ Value = $ row ['Album_name']; print "& lt; Option value = ''. $ Album_id "'& Gt;" $ Value "& Lt; / option & gt;"; } ....  

Then the submission variable (admin.php) will contain the id in the post variable album , no need for hidden input < / P>


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -