TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 02-01-2010, 05:40 AM   #1 (permalink)
The Acquainted
 
Dave's Avatar
 
Join Date: Apr 2008
Posts: 110
Thanks: 97
Dave is on a distinguished road
Default Checkboxes and db rows

Hello again.

I have a query that pulls rows from a mysql db. The data is displayed in a simple HTML table. The first column of the HTML table has a checkbox for each row. It looks a little like this:


PHP Code:
+-----------+----------+----------+
|   
SELECT  |    NAME  |    ID    |
+-----------+----------+----------+
|   [
ckbx]  |    John  |    2233  |
+-----------+----------+----------+
|   [
ckbx]  |    Susie |    5577  |
+-----------+----------+----------+

SUBMIT 

The user is allowed to select rows, each of which has a unique ID. I have spent untold hours trying to understand how to know which rows (i.e., the unique ids) were selected by checkboxes. How would I go about this?

The HTML table is on a form with a POST method. So, for example, if a user checks the checkbox on John's row, how can I retrieve John's ID into a $_POST array?

None of my books go into this specifically. They only give checkbox examples such as What is your fav. ice cream? Vanilla, Chocolate, blah, blah.

Thanks!
Dave

Note: the above table is, of course, simplified. The HTML table actually contains about a dozen fields and up to a couple of hundred records resulting fromt the db query.
Dave is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fancy Form checkboxes Kay1021 General 13 06-02-2009 08:53 PM
new JS project... allworknoplay Javascript, AJAX, E4X 21 04-25-2009 11:27 PM
How to locate certain checkboxes benton Javascript, AJAX, E4X 4 01-08-2009 11:04 PM
jQuery and firefox checkboxes?? drewbee Javascript, AJAX, E4X 1 08-27-2008 05:54 PM


All times are GMT. The time now is 07:13 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design