Forums
This topic is locked
MULTIPLE CHECKBOXS TO CARRY OUT A SEARCH QUERY
10 Oct 2003 00:14:09 MAC MAC posted:
DREAMWEVER MX PHP_MYSQL I WANT TO USE Multi CHECKBOXS TO CARRY OUT A SEARCH QUERY.
MY fORM USES $HTTP_GET_VARS
They way i think it sould work is as follows ?
I NEED TO MAKE THE CHECKBOXES IN TO ARRAYS on the page with the search ie.
input name="sizeID[]" type="checkbox" id="sizeID[]" value="1"
input name="sizeID[]" type="checkbox" id="sizeID[]" value="2"
input name="sizeID[]" type="checkbox" id="sizeID[]" value="3"
On the results page I need to modify (isset)the standard DW code at the line below - and use implode so i can convert the Array into a string.
if (isset($HTTP_GET_VARS["sizeID"])) {
colname_RSbrand = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS["sizeID"] : addslashes($HTTP_GET_VARS["sizeID"]);
}
I am tearing my hair out (whats Left of it ) trying to get the syntax to work. I have searched the talkzone but found nothing to assist.
Replies
Replied 10 Oct 2003 02:37:24
10 Oct 2003 02:37:24 MAC MAC replied:
this is what is change so far also the error i get.
if (isset($HTTP_GET_VARS["sizeID"])) {
$size = implode(',',$HTTP_GET_VARS['sizeID']);
// colname_RSbrand = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS["sizeID"] : addslashes($HTTP_GET_VARS["sizeID"]);
$colname_rscat = $size;
}
i get error "You have an error in your SQL syntax near '4 AND sizeID = Array at line 1"
if (isset($HTTP_GET_VARS["sizeID"])) {
$size = implode(',',$HTTP_GET_VARS['sizeID']);
// colname_RSbrand = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS["sizeID"] : addslashes($HTTP_GET_VARS["sizeID"]);
$colname_rscat = $size;
}
i get error "You have an error in your SQL syntax near '4 AND sizeID = Array at line 1"