|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Please can anyone help me
Sorry im new at this, What im trying to do is create two drop down select boxes, The first box will contain the result of a quary my a mysql database table, and depending on what is selected in the first drop down select box a second quary will displayed in the second drop down select box.
I need to then pass the selected option on so they can be saved to a table. Here is my code, Please if anyone can help i would be grateful. Many Thanks in Advance: <html> <head> <title>test</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <? $db = mysql_connect("localhost", "ts_user", "password"); mysql_select_db (test); // get project id of all project of user $query= mysql_query ("select projectid from projectgroup where userid ='testid'"); print "<form method=post action="next.html">"; print "<table border=0 align=center width=90%>"; print "<tr>"; print " <td> <br><br><br>Please select the type of package required<br><br></td>"; print "</tr>"; print "<tr>"; $sel; $q=1; $h; //print " <td> <select onchange ="location = this.options [this.selectedIndex].value;" name="$pname">n"; print " <td> <select onchange = $sel = this.options [this.selectedIndex].value;" name="$pname">n"; while( $row = mysql_fetch_row ($query)) { // print "<option value=$h=("name".$q)>".$row[0]; print "<option value=$h=("$q")>".$row[0]; $q++; $h++; } print "</SELECT>n"; // get project name $query1= mysql_query ("select projectid, projectname from project where projectid= $h"); print " </td>"; print "</tr>"; print " <td> <select name="$name">n"; while( $row = mysql_fetch_row ($query1)) { print "<option value="name">".$row[0]." --- ".$row[1]; } print "</SELECT>n"; print " </td>"; print "</tr>"; print "<tr>"; print " <td align=right><br><INPUT TYPE=submit VALUE="Submit"></td>"; print "</tr>"; print "</table>"; print "</form>"; ?> </body> </html> |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > Please can anyone help me |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|
|