Jump to content

Complex query help: multiple fields & multi-select list boxes


webguy262

Recommended Posts

I need some help with the query for a form that selects values across multiple columns, and allow users to select multiple values in several columns.

 

    http://brinsterinc.com/tpa/tpasearch.php

 

I assume you build the where clause for the sql by determining if there is an option value has been selected in the single-value select boxes.

 

But how do I handle the multi-select list boxes?

 

I'm desperate for help!  Need to get somewhere with this over the weekend!

 

TIA!

$searchStr = array();

foreach ($_POST['s_TPABookOfBusinessPartCount'] as $str)
$searchStr[] = '"'.mysql_real_escape_str($str).'"';

$searchStr = implode(",", $searchStr);

...

$query = ".... field_name IN (".$searchStr.")...";

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.