Reply to Re: array output for select statement

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация