Hi All,
I have input for where users can enter order numbers in which to search the database to find results matching their entry.
To enter multiple order numbers they can comma separate like: 1,34,21,34,54
Let's say you place these in the following variable
<?
$ordernum = "1,34,21,34,54";
$orderarr = explode(",", $ordernum);
$count = 0; foreach ($orderarr as $id) { if ($count == 0) { $orderstr = $orderstr . " '" . $id . "' "; } else { $orderstr = $orderstr . ", '" . $id . "' "; } $count++; } $query = "(cart_id in($orderstr) OR id in($orderstr))";
echo $query;
?>
What I need to do is take those numbers and make a query that would like like:
(cart_id in('1','34','21','34','54') OR id in('1','34','21','34','54'))
ANY idea how I can accomplish this?
Thanks all!
Aaron
David G. O'Brien Web Services Coordinator / Systems Administrator
NACCRRA The Nation's Network of Child Care Resource & Referral 1319 F Street NW, Suite 500 Washington, DC 20004 (202) 393-5501 ext. 113 (202) 393-1109 fax
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php