Get ready for BLACK FRIDAY shopping starting in

Forums

This topic is locked

dynamic lists

Posted 01 Jul 2006 00:26:27
1
has voted
01 Jul 2006 00:26:27 PENELOPE SOUANI posted:
Hi to everyone,

Here is my problem: I am developing a site with Dreamweaver, its a dynamic one, I use PHP and MySql, I have in my database a table with healing methods and an other one with teachers of this methods, and a table which joins these two table where I have Methods_id and teachers_id. Many teachers can teach many methods. I am trying to make a search page where the user will select from a list menu with the names of the methods he wants to search for a teacher. Then I want by clicking the SUBMIT button to go an other page and display all the teachers for the method he choose. What do I have to use so the ID for methods passes to the link page, in order to display the teachers? Any help would be welcome!
Sorry in advance for my english.
Penelope

Replies

Replied 04 Jul 2006 17:53:51
04 Jul 2006 17:53:51 Roddy Dairion replied:
Use GET instead of POST. So in you form tag "method" should be GET instead of POST.
Replied 04 Jul 2006 23:07:29
04 Jul 2006 23:07:29 PENELOPE SOUANI replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Use GET instead of POST. So in you form tag "method" should be GET instead of POST.
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Hi! and thanks for answering. I already have GET in my form. Here is my code:

&lt;form id="form2" name="form2" method="get" action="training.php"&gt;
&lt;label&gt;Method:
&lt;select name="select" size="1" class="style7"&gt;
&lt;?php
do {
?&gt;
&lt;option value="&lt;?php echo $row_Recordset1['id']?&gt;"&gt;&lt;?php echo $row_Recordset1['title']?&gt;&lt;/option&gt;
&lt;?php
} while ($row_Recordset1 = mysql_fetch_assoc($Recordset1));
$rows = mysql_num_rows($Recordset1);
if($rows &gt; 0) {
mysql_data_seek($Recordset1, 0);
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
}
?&gt;
&lt;/select&gt;
&lt;input name="Submit" type="submit" id="Submit" value="Submit" /&gt;
&lt;/label&gt;
&lt;/form&gt;
When I click submit it gets a blank result page.
Is there any special code that I have to put in my result page (training.php) ? It has a recordset which retrieves the data for the teachers with a repeat region.

Thanks in advance
Penelope
Replied 05 Jul 2006 09:27:47
05 Jul 2006 09:27:47 Roddy Dairion replied:
yes in your select query on your training page your have to use the param in the link to get the value i.e something like this
select * from teacher_table where teacher_id = ".$_GET['select'];

$_GET['select'] --&gt; the name select will depend on the name of the list menu
Replied 05 Jul 2006 12:46:43
05 Jul 2006 12:46:43 PENELOPE SOUANI replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
yes in your select query on your training page your have to use the param in the link to get the value i.e something like this
select * from teacher_table where teacher_id = ".$_GET['select'];

$_GET['select'] --&gt; the name select will depend on the name of the list menu
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Thanks so much for your help. Sometimes you can't see the obvious...
Penelope
Replied 05 Jul 2006 13:16:28
05 Jul 2006 13:16:28 Roddy Dairion replied:
Glad i could help.

Reply to this topic