couple of problems with two dif set of arrays...
Posted: Thu Sep 11, 2008 9:40 am
~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:
Posting Code in the Forums to learn how to do it too.
i have a large form - someone in here kindly showed me how to concantenate this array into a query:
this works with a set of integers, but i have arrays that are abbreviations, AL, AK, AR etc, with which i'm getting errors, and i'm assuming i have to get them in quotes, but i don't know how (if that's the problem). believe me, i've tried, and i have no idea how to find something like this in documentation at mysql.com or php.net or anywhere...
//*******************//
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.
i really appreciate any help that someone can offer. when i see code, i can see how something's done much more easily than reading or hearing "how" to do it...
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:
Posting Code in the Forums to learn how to do it too.
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: