Klam Posted November 28, 2006 Share Posted November 28, 2006 I am new to the php I want to know how to incoperate the php code (functions) with button or down dropmenu I want to know how to call those those event handler and activate the functionsBasically what I am doing is like thisSelect the drop down menu and select the value and click ok and display the value on the text.I also want to know how to blind the values from the database which is access into the drop down menu I am using a dreamweaver mx 2004 Link to comment https://forums.phpfreaks.com/topic/28708-button-drop-down-menu-event-handler/ Share on other sites More sharing options...
joshi_v Posted November 28, 2006 Share Posted November 28, 2006 For the first thing you can use javascript.Second one, i couldn't understand completely what you intended to.I think you are tryign to display the databses values in select menu.That you cna do like this...<?php[code]$sq="select * from table_name";$qry=mysql_query($sq) or die (mysql_error());echo "<select name="test">while($res=mysql_fetch_array($qry)){echo "<option value="$res['name']">$res['name']</option>";}echo "</select>";?>[/code]If this is what you are looking for , then ok.Else exapnd your description little bit.Regards,Joshi. Link to comment https://forums.phpfreaks.com/topic/28708-button-drop-down-menu-event-handler/#findComment-131513 Share on other sites More sharing options...
Klam Posted November 29, 2006 Author Share Posted November 29, 2006 Thats what I want thanks. But there was some mistake in that code[code]$sq="select * from table_name";$qry=mysql_query($sq) or die (mysql_error());echo '<select name="test">';while($res=mysql_fetch_array($qry)){echo "<option value='.$res['name'].'>'.$res['name']'.</option>';}echo '</select>';[/code] Link to comment https://forums.phpfreaks.com/topic/28708-button-drop-down-menu-event-handler/#findComment-132007 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.