may be like this

 $db = Doctrine_Manager::connection();
 $sql = "insert into tags(name) value('$name') on duplicate key upadte
count=count+1";
 $db->exec($sql);

or with prepare statement (NO sql-inject)

 $db = Doctrine_Manager::connection();
 $sql = "insert into tags(name) value(?) on duplicate key upadte
count=count+1";
 $stmt = $db->prepare($sql);
 $stmt->execute(array($name));




On Mar 5, 8:37 am, Tom Ptacnik <to...@tomor.cz> wrote:
> I'm not good at doctrine at all, but I think that i you don't know how
> to write this in DQL (Doctrine Query Language) there is a way how to
> write pure SQL and execute it
>
> On 4 bře, 08:58, SymfonyNewbie <shore.cl...@gmail.com> wrote:
>
> > You are right,I'm using doctrine.
>
> > Looking for information how it deals with dml like "insert .. on
> > duplicate key update"..
>
> > On 3月4日, 下午2时38分, Tom Ptacnik <to...@tomor.cz> wrote:
>
> > > It depends on which ORM do you use.. Propel or Doctrine?
>
> > > I think this is more about ORM than symfony...
>
> > > On 3 bře, 13:07, SymfonyNewbie <shore.cl...@gmail.com> wrote:
>
> > > > The relation between posts and tags is n2m,
>
> > > > the pure mysql solution is like this:
>
> > > >     $dml = "insert into tags(name) value('$name') on duplicate key
> > > > upadte count=count+1";
> > > >     mysql_query($dml);
> > > >     $dml = "insert into tagowner(post,tag) value($postid,$tagid)";
> > > >     mysql_query($dml);
>
> > > > How to do similar things in symfony?- 隐藏被引用文字 -
>
> > > - 显示引用的文字 -

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to