PDA

View Full Version : One to many with drop down



kamilsey
05-11-2005, 10:35 AM
Hi Guys

I have 1 page in my site that requires data from differnt tables in my DB. This i have done and it works fine. My problem is:- it requests data from the tables and only 1 record is returned as per the query string. However i do have one record that is returned that has more than one record (and link). I can get these to display what i want by using the info i found on this site http://home.att.net/~codeLibrary/FrontPage/detail.htm but i want this information to be displayed as a drop down with a link. I can get it to display as a drop down but it shows several drop down doxes with the differnt results. If i use the code from the above link(using it for the whole table thus only having one line) it will display only the first record.
Here is the code
<% end if %>
<%
fp_sQry="SELECT * FROM tariffs,phones,addons,phonetariff WHERE (Tarriff = '::Tariff::') AND (model = '::model::') AND (ptid = '::ptid::')"
fp_sDefault="Tariff=&model=&ptid="
fp_sNoRecords="<tr><td colspan=55 align=""LEFT"" width=""100%""></td></tr>"
fp_sDataConn="dragondb"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice="name"
fp_sMenuValue="name"
fp_sColTypes="&ID=3&Tarriff=202&Supplier=202&Minutes=3&Texts=3&Price=3&Daytime_ln=3&Daytime_om=3&Daytime_on=3&Eve/Wknd_ln=3&Eve/Wknd_om=3&Eve/Wknd_on=3&Voicemail Retrieval_day=3&Voicemail Retrieval_eve/wknd=3&Fax/Data_day=3&Fax/Data_eve/wknd=3&MMS Per Message_picture=3&MMS Per Message_video=3&SMS Per Message=3&Orange Care=3&Non Direct Debit Fee=3&ID=3&side=3&manu=202&model=202&desc=203&feat1=202&feat2=202&feat3=202&feat4=202&feat5=202&feat6=202&feat7=202&feat8=202&feat9=202&feat10=202&feat11=202&feat12=202&feat13=202&feat14=202&feat15=202&paygprice=202&weight=202&battstand=202&batttalk=202&imgsma=202&imglar=202&ID=3&name=202&offer=202&cost=202&ptid=3&ptmodel=202&ptTariff=202&ptPrice=3&"
fp_iDisplayCols=55
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<%
If fp_rs("imgsma") <> savedID Then
savedID = fp_rs("imgsma")
%>
<tr>
<td width="158"><font face="Verdana">Network:
<%=FP_FieldVal(fp_rs,"Supplier")%><br>
Tariff:
<%=FP_FieldVal(fp_rs,"Tarriff")%><br>
Phone:
<%=FP_FieldVal(fp_rs,"manu")%>&nbsp;
<%=FP_FieldVal(fp_rs,"model")%>
<br>
£<%=FP_FieldVal(fp_rs,"ptPrice")%></font></td>
<td width="42"><font face="Verdana">
<%=FP_Field(fp_rs,"imgsma")%></font></td>
<td colspan="3"><font face="Verdana">Please select any add
ons you want</font></td>
</tr>><%
End If
%>

<tr>
<td width="158"></td>
<td width="42">&nbsp;</td>
<td width="174">
<select NAME="name" SIZE="1">
<option><%=FP_Field(fp_rs,"name")%> @ £<%=FP_Field(fp_rs,"cost")%> p/m </option>
</select><font face="Verdana" size="1"></td>
<td width="44">
<font face="Verdana" size="2">£</font></td>
<td width="124">
<a href="buy3.asp?Tarriff=<%=FP_FieldURL(fp_rs,"Tarriff")%>&model=<%=FP_FieldURL(fp_rs,"model")%>&name=<%=FP_FieldURL(fp_rs,"name")%>&ptid=<%=FP_FieldURL(fp_rs,"ptid")%>">Add</a></td>
</tr>
<!--#include file="_fpclass/fpdbrgn2.inc"-->
</tbody>

Any Ideas

no_mac_jack
05-19-2005, 09:40 PM
You lost me. If you want to have several things in the drop down menu, you may need to have a separate database region that builds the code for the menu and then you would just response.write it wherever you need it later. Do you have a link to something we could take a look at to see what you've got?

Thanks,
~no_mac_jack

kamilsey
05-20-2005, 05:03 AM
Hey no mac

Im just setting up a site now so you can take a look. Ill let you know the address in a bit

Cheers

Kamilsey