This topic is locked
[SOLVED]

 List View as dropdown menu?

4/20/2009 3:41:30 AM
PHPRunner General questions
S
stevenf author

Hi,
My list view has too many records, so I was thinking of being able to have just one field but in a dropdown menu, is this possible?
It's just too hard to look for anything when there's so many record <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=11595&image=1&table=forumtopics' class='bbc_emoticon' alt=':(' />
Hope someone can help.
thx
stevenf.

J
Jane 4/20/2009
S
stevenf author 4/21/2009

Hi,

please check this thread:

http://www.asprunner.com/forums/index.php?showtopic=2301


Hi Jane,
Yes, this is what I needed but a little bit different.
I have a table which contains page id's called page_ids
Now, I need the search query to be done on all table.
The dropdown menu would have the list of the page_ids, which I carrently have BUT the for the search query I need it to:
select * from (all tables) where page_id = the selected page_ids
Hope you can help.
thanks

J
Jane 4/21/2009

Steven,
I'm not sure that I understand you correctly.

How do you want to select search parameters?

You can publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages and I'll try tp help you.

S
stevenf author 4/21/2009

Steven,

I'm not sure that I understand you correctly.

How do you want to select search parameters?

You can publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages and I'll try tp help you.


Actually, I didn't explain properly.
I have a table called page_ids which contains just page id's
And I have another table which contains the same page id's BUT the field is called page_id.
So, table 1 field = page_ids

table 2 field = page_id.
Now, I have a dropdown menu which contains all the page id's from table 1
When I select a page id on the dropdown I need it to list all selected page_ids which match table 2 page_id
So, the dropdown list comes from table 1 and when selected in displays all matching from table 2
Hope it's better explained.
thanks
stevenf

J
Jane 4/21/2009

Hi,
here is just a sample:

//create dropdown box

$str = "";

$str.= "<select onchange=\"window.location.href=this.options[this.selectedIndex].value;\"><option value=\"\">Please select</option>";
//select values from table 1

global $conn;

$strSQL = "select page_id from table1";

$rs = db_query($strSQL,$conn);

while ($data = db_fetch_array($rs))

$str.="<option value=\"table2_list.php?a=search&value=1&SearchFor=".$data["page_id"]."&SearchOption=Contains&SearchField=page_id\">".$data["page_id"]."</option>";
$str.="</select>";

echo $str;

S
stevenf author 4/21/2009

Hi,

here is just a sample:


Hi jane,
Just one thing I'm confused about (fields)
On table 1 for field name is page_ids
so it would be: $strSQL = "select page_ids from table1";
BUT in table 2 the field is called page_id ...
So, my question is, which field name do I put at the bottom here:
$str.="<option value=\"table2_list.php?a=search&value=1&SearchFor=".$data["page_id"]."&SearchOption=Contains&SearchField=page_id\">".$data["page_id"]."</option>";
page_ids or page_id?
thanks a lot