i have a large form - someone in here kindly showed me how to concantenate this array into a query:
Code: Select all
$twofour = $_POST['twofour'];
if ($twofour != '') {
$twofour_sql = implode(',',$twofour);
} else {
if ($twofour == '') {
$twofour_sql = '';
}
}
if ($twofour_sql != '') {
$where[] = "prg_2_year IN ($twofour_sql)";
}
//*******************//
i have an array where i need to use BETWEEN like this: ...from table WHERE enrollment BETWEEN 1 and 200 OR BETWEEN 201 and 500...
i made the values of the checkboxes "1 and 200" and "201 and 500", but i still can't configure the Form/function correctly.
Code: Select all
$enrollment = $_POST['enrollment'];
if ($enrollment != '') {
$enrollment = implode(',',$enrollment);
} else {
if ($enrollment == '') {
$enrollment = "";
}
}
if ($enrollment != '') {
$where[] = "enrollment BETWEEN $enrollment";
}
Thanks again,
GN
~pickle | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: