marksie1988 Posted July 24, 2007 Share Posted July 24, 2007 is it possible to show a column from mysql in a dropdown and then when that row is selected to display the information in an editable form ?? if you dont understand i can try explain in more detail Quote Link to comment Share on other sites More sharing options...
marksie1988 Posted July 24, 2007 Author Share Posted July 24, 2007 ok i got the dropdown working by using the following code <?php $res = mysql_query("SELECT * FROM songs ORDER BY title") or die("Invalid query: " . mysql_query()); echo '<label>Select value:</label>'; echo '<select id="song" name="song">'; echo '<option value="">Select</option>'; while ($row = mysql_fetch_assoc($res)) { $va = $row['title']; echo "<option value='$va'>$va</option>"; } echo '</select>'; ?> but how could i use this so that when an admin selects a song title they can view lyrics to edit them ? (lyrics column is called lyrics) Quote Link to comment Share on other sites More sharing options...
marksie1988 Posted July 25, 2007 Author Share Posted July 25, 2007 does nobody know how i can do this i cannot find anything about this on the net please help me or tell me if it isnt possible Quote Link to comment Share on other sites More sharing options...
dg Posted July 25, 2007 Share Posted July 25, 2007 on select of the song ...... can open a new window (probably modal) and pass the song id and dispay the lyrics in new window .... where edit is possible ... Quote Link to comment Share on other sites More sharing options...
plutomed Posted July 25, 2007 Share Posted July 25, 2007 Is that innside a form, if so then you can send the info. via get or post which is then retrievable via the thepage you set it to send to in the action parameter, if you get me. Quote Link to comment Share on other sites More sharing options...
dg Posted July 25, 2007 Share Posted July 25, 2007 it should be onselect or onchange event of dropdown...... using a GET method pass the song id Quote Link to comment Share on other sites More sharing options...
marksie1988 Posted July 25, 2007 Author Share Posted July 25, 2007 ok but how would i do this ? any example code? Quote Link to comment Share on other sites More sharing options...
marksie1988 Posted July 26, 2007 Author Share Posted July 26, 2007 would it be possible to select the song title from the dropdown and then on select get the id and go to an edit page edit_song.php?id=23 then when the fields are changed and submit is selected it will update the row with id 23 i think this should be possible but i dont know much about dropdown menu's so i wouldnt know how to tell it to get the id and then go to the edit page please help i really need this now Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.