By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 1,935 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

Identifying user's pick from selection list

P: n/a
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
Jul 17 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
I noticed that Message-ID:
<5e**************************@posting.google.com > from Mark contained
the following:
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.


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/
Jul 17 '05 #2

P: n/a
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 <bl******@ckdog.co.uk> wrote in message news:<0e********************************@4ax.com>. ..
I noticed that Message-ID:
<5e**************************@posting.google.com > from Mark contained
the following:
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.


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.

Jul 17 '05 #3

P: n/a
I noticed that Message-ID:
<5e**************************@posting.google.com > from Mark contained
the following:
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?


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/
Jul 17 '05 #4

P: n/a
On Mon, 15 Dec 2003 19:51:19 +0000, Geoff Berrow
<bl******@ckdog.co.uk> brought forth from the murky depths:
I noticed that Message-ID:
<5e**************************@posting.google.co m> from Mark contained
the following:
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?


None at all. You'd have to post your code.


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
Jul 17 '05 #5

P: n/a
I noticed that Message-ID: <d3********************************@4ax.com>
from Larry Jaques <jake@di\/ersify.com> contained the following:
worked great. Any idea why the period is there?


None at all. You'd have to post your code.


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


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/
Jul 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.