You are here: Re: [PHP] Array Select from database « PHP « IT news, forums, messages
Re: [PHP] Array Select from database

Posted by Silvio Porcellana on 09/28/05 19:37

A.J. Brown wrote:
>
> [code]
> $values = join(', ', $array);
> $query = "SELECT * FROM client WHERE clientaccountmanager IN ('$values')"
> [/code]
>
Actually this doesn't seem right, the join should be:
$values = join("', '", $array); # notice the ' inside the "

In addiction, I would (SQL)escape the values joined: supposing you are
using MySQL, I'd do:
$values = join("', '", array_map('mysql_real_escape_string', $array));

HTH, cheers
Silvio

 

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

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