Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pulling a data from array of checkboxes 1

Status
Not open for further replies.

sharapov

MIS
May 28, 2002
106
US
I am passing a value of checkboxes in a form to a new page like this (see example here: In a new page how can I pull the data from a MySQL database according to each value I passed from a previous page? In other words: Assume that the value of a checkbox equal to the ID of the record in a database. The value of checkbox 1 (for example) is 12345 and the value of checkbox2 is 67890. After passing those values to a new page how can I pull the rest of the information from a database for those values?
 
you should name the checkboxes as array like this

<input type=checkbox name=boxes[] value=12345>
<input type=checkbox name=boxes[] value=67890>

then, in the second page, execute this query:

&quot;SELECT * from table where id in (&quot;.implode(&quot;,&quot;,$_POST[boxes]).&quot;)&quot;


Anikin
Hugo Alexandre Dias
Web-Programmer
anikin_jedi@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top