explode () and mySQL query
[email protected] (Ron Piggott)
| Newsgroups | php.db |
|---|---|
| Organization | Acts Ministries Christian Evangelism |
| Message-ID | <[email protected]> |
I am trying to add a search feature to my shopping cart.
I am wanting to use PHP to develop the query for mySQL. I have the
following code figured out:
foreach(explode(" ", $keyword) as $key) $query .= " $key, ";
This produces:
WHERE shopping_cart_product.product_description IN ( Jesus, is, Lord, )
The weakness is the trailing , after the last word the user types in.
How can I eliminate this?
Ron