php - selecting value from drop down dropdown -
Hello, I am going to edit the drop down box value, how do I show values from the previous database like V
`< Input name = "initial" size = "8" value = "& lt ;? php resonant $ res ['beginners'] ;? & gt;" / `& gt; So how can I do this code for this
& lt; Select name = "employee_id" id = "employee_id" & gt; & Lt; Option value = "" & gt; Select & lt; / Options & gt; & Lt ;? Php $ Task = new task (); $ Task- & gt; Connect (); Echoes $ emp = $ work- & gt; GetEmployee (); $ Task- & gt; Disconnect (); ? & Gt; & Lt; / Select & gt; Function getEmployee () {$ this- & gt; Query = ("select from employee"); $ Rd = $ this- & gt; ExecuteQuery (); While ($ line = mysqli_fetch_assoc ($ rd)) {$ pno = $ row ['pno']; $ Name = $ line ['name']; Echo "& lt; option value = '$ pno' & gt; $ name & lt; / option & gt;"; }}} If I place it here in the value value then it will be considered as one but it will not show in the drop down box. So in a nutshell, this assumes from the array and shows in the dropdown box
This selects your desired value Will your dropdown list
echo "& lt; option value = '$ pno'". ($ Pno == $ picker? "Selected = 'selected'": ""). "& Gt; $ name & lt; / options & gt;";
Comments
Post a Comment