Connecting Tech Pros Worldwide Help | Site Map

Identifying user's pick from selection list

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 01:38 AM
Mark
Guest
 
Posts: n/a
Default Identifying user's pick from selection list

I have an application that uses PHP to access a MySQL table and
extract rows which match the user's search entry. Data from the
matching rows are loaded into an HTML selection list, and the user can
scan the list and highlight a selected item.

My question: In PHP, what is the syntax for identifying which row is
highlighted?

My goal is to pass the unique row ID of the selected item to a
subsequent form where all the fields will be displayed for the user to
edit.

I already have the code that loads the selection list and the code
that displays the fields. I just need to know how to determine the
highlighted item.

I have two PHP books, and both discuss loading the selection list, but
there is no mention of what to do next.

Thanks!!
Mark Jones

  #2  
Old July 17th, 2005, 01:38 AM
Geoff Berrow
Guest
 
Posts: n/a
Default Re: Identifying user's pick from selection list

I noticed that Message-ID:
<5e55e3c8.0312130815.4aef703a@posting.google.com > from Mark contained
the following:
[color=blue]
>My goal is to pass the unique row ID of the selected item to a
>subsequent form where all the fields will be displayed for the user to
>edit.
>
>I already have the code that loads the selection list and the code
>that displays the fields. I just need to know how to determine the
>highlighted item.[/color]

assuming you have your select box set-up like this:

<select name="rowselector">
<option value="rowID">Row description</option>
next option etc..
</select>

The highlighted value will be passed back as the variable
$_POST["rowselector"]

Just do a query with that value in the WHERE clause and populate the
form with the results.


--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
  #3  
Old July 17th, 2005, 01:40 AM
Mark
Guest
 
Posts: n/a
Default Re: Identifying user's pick from selection list

Thanks, Geoff! That worked. The only thing I'm still wondering about
is the value returned in $_POST["rowselector"] is followed by a
period. I used the trim function to remove the period and the query
worked great. Any idea why the period is there?

Many thanks,
Mark Jones

Geoff Berrow <blthecat@ckdog.co.uk> wrote in message news:<0ekmtvc8imoanerqptugruccar1ck84p6k@4ax.com>. ..[color=blue]
> I noticed that Message-ID:
> <5e55e3c8.0312130815.4aef703a@posting.google.com > from Mark contained
> the following:
>[color=green]
> >My goal is to pass the unique row ID of the selected item to a
> >subsequent form where all the fields will be displayed for the user to
> >edit.
> >
> >I already have the code that loads the selection list and the code
> >that displays the fields. I just need to know how to determine the
> >highlighted item.[/color]
>
> assuming you have your select box set-up like this:
>
> <select name="rowselector">
> <option value="rowID">Row description</option>
> next option etc..
> </select>
>
> The highlighted value will be passed back as the variable
> $_POST["rowselector"]
>
> Just do a query with that value in the WHERE clause and populate the
> form with the results.[/color]
  #4  
Old July 17th, 2005, 01:40 AM
Geoff Berrow
Guest
 
Posts: n/a
Default Re: Identifying user's pick from selection list

I noticed that Message-ID:
<5e55e3c8.0312151050.5f1381c8@posting.google.com > from Mark contained
the following:
[color=blue]
>Thanks, Geoff! That worked. The only thing I'm still wondering about
>is the value returned in $_POST["rowselector"] is followed by a
>period. I used the trim function to remove the period and the query
>worked great. Any idea why the period is there?[/color]

None at all. You'd have to post your code.
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
  #5  
Old July 17th, 2005, 01:40 AM
Larry Jaques
Guest
 
Posts: n/a
Default Re: Identifying user's pick from selection list

On Mon, 15 Dec 2003 19:51:19 +0000, Geoff Berrow
<blthecat@ckdog.co.uk> brought forth from the murky depths:
[color=blue]
>I noticed that Message-ID:
><5e55e3c8.0312151050.5f1381c8@posting.google.co m> from Mark contained
>the following:
>[color=green]
>>Thanks, Geoff! That worked. The only thing I'm still wondering about
>>is the value returned in $_POST["rowselector"] is followed by a
>>period. I used the trim function to remove the period and the query
>>worked great. Any idea why the period is there?[/color]
>
>None at all. You'd have to post your code.[/color]

You really should have known the answer to that one, Geoff.
It was, of course, a female file. <gd&r>


---
- Sarcasm is just one more service we offer. -
http://diversify.com Web Applications
  #6  
Old July 17th, 2005, 01:41 AM
Geoff Berrow
Guest
 
Posts: n/a
Default Re: Identifying user's pick from selection list

I noticed that Message-ID: <d33ttv0f7gkitmi76f2959ma95r59c97s4@4ax.com>
from Larry Jaques <jake@di\/ersify.com> contained the following:
[color=blue][color=green][color=darkred]
>>>worked great. Any idea why the period is there?[/color]
>>
>>None at all. You'd have to post your code.[/color]
>
>You really should have known the answer to that one, Geoff.
>It was, of course, a female file. <gd&r>[/color]

And here was me thinking it might just have been the Christmas period.
:-)

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.