You are here: Re: A query from $_POST using foreach « All PHP « IT news, forums, messages
Re: A query from $_POST using foreach

Posted by ZeldorBlat on 11/08/06 17:49

Steve wrote:
> | $query .= explode(" AND ", $_POST);
> |
> | easy as that, however i assume given the lack of FIELD = VALUE in your
> | example, that you are building a list. in that case, it is more efficient
> to
> | do:
> |
> | $query .= "WHERE someField IN ('" . explode("', '", $_POST) . "')";
>
> ooops. correction (not to be confused with bickering, esp. with self ;^)
>
> either:
>
> $query .= explode(" AND ", array_values($_POST));
>
> or:
>
> $query .= "WHERE someField IN ('" . explode("', '", array_values($_POST)) .
> "')";

Wrong direction. Use implode in this case, not explode.

 

Navigation:

[Reply to this 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

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