Good day!
Here I try to make a drop-down list in which the data from the database would be loaded ... and the written code does not work ... please tell me what is wrong.

<SELECT NAME="а"> <? $result = mysql_query("SELECT * FROM `wayflag` WHERE `rn` = '".$_GET['rn']."' ORDER BY `atitle`",$link); $myrow = mysql_fetch_array($result); do { printf ("<option value='%s'>%s</option>",$myrow["obj"],$myrow["atitle"]); } while ($myrow = mysql_fetch_array($result)); ?> </SELECT> 

    1 answer 1

    "Does not work" - a loose concept. What exactly is wrong? What error gives? Try to convert the global variable $ _GET ['rn'] to normal before the query and write this way:

     $rn = $_GET['rn']; $result = mysql_query("SELECT * FROM `wayflag` WHERE `rn` = '$rn' ORDER BY `atitle`",$link); echo '<select name="а">'; while ($myrow = mysql_fetch_array($result)){ printf ("<option value='%s'>%s</option>",$myrow["obj"],$myrow["atitle"]); } echo '</select>'; 
    • Thanks for the answer!!! With the help of him, I found where the “dog is buried” :) - it was not the field that passed (Conclusion, it is harmful to work at night!) - Vasiok