Posted by Markus L. on 01/26/05 23:22
Michael wrote:
> Hi Everybody,
>
> I have an array that outputs the ID's of a table after a keyword search. I
> am not sure how the select statement should look like to have all "ID"
> numbers generated by a foreach loop. Thanks for any advice!
>
>
> $mysearchterms = $_POST['searchtext'];
>
> if ($mysearchterms != '') {
>
> require('search_class.php');
>
> $mysearch = new MysqlSearch;
> $mysearch->set_Identifier("model_id");
> $mysearch->set_SearchTable("model");
> $mysearch->set_SearchColumns("model, description");
> $mysearch->get_ErrorStr();
> $result_arry = $mysearch->find($mysearchterms);
> -------------------------------------------------------------------------------------------------
$where = array();
> foreach ($result_arry as $value)
{
$where[] = "model_id = '$value'";
}
> ---------------------------------------------------------------------------------------------------
>
$output= @mysql_query('SELECT * FROM model WHERE ' . implode(' OR ',
$where));
>
> while ($model01 = mysql_fetch_array($output)) {
>
>
--
-------------------------------------------------------
Try this: SCA the Smart Class Archive for PHP
http://www.project-sca.org
-------------------------------------------------------
[Back to original message]
|