Reply to Re: dumping a array into PDO::db using place holders.

Your name:

Reply:


Posted by Rowan on 01/07/08 22:31

On Jan 6, 8:15 pm, Rowan <yaard...@gmail.com> wrote:
> I'm trying to enter data from an array ( eg entry1=(x=>y,a=b),
> entry2=(x=>y,a=>c)) I'm trying to use place holders to dump the data.
> It maybe late but I can't get this to work. below is the actual
> routine used to exec. any idea on how to better format this.
>

figured out the problem. For reference see below I got this from the
php.net page.

If you're using bindParam in a loop such as this:

$counter=1;
foreach($email as $val){
$stmt->bindParam($counter, $val, PDO::PARAM_STR);
$counter++;
}

It will fail because $val is local and the variable is bound as a
reference and will only be evaluated at the time that PDOStatement-
>execute() is called.

So use bindValue instead.

[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

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