Options

query to sqlBuilder question

edited January 2007 in Vanilla 1.0 Help
Hi there, I want to do this query with the sqlBuilder update `mytestDB`.`Table_Comment` set `DiscussionID`='2' where `DiscussionID`='10' and `CommentID`='19' and I've tried this with the sqlBuilder: $s->SetMainTable('Comment', 'c'); $s->AddFieldNameValue('DiscussionID',$Discussion->DiscussionID); // this is the new discussion for instance the "set `DiscussionID`='2'" $s->AddWhere('c','DiscussionID','=',$currentDiscussionID, 'and','CommentID','=',$item); // and here the "where `DiscussionID`='10' and `CommentID`='19' " $this->Context->Database->Update($s, $this->Name, 'SaveComment', 'An error occurred while updating discussion properties.'); What I'm missing? maybe I should update the discussion manager function instead of the savecomment function of the comment manager?? do I have to attach it to a function? I just want to update the db with my changes at the end... EDIT well it was the AddWhere that was wrong now it works with this: $s->AddWhere('c', 'CommentID', '', $item, '='); that was so easy!! blame on me....why I did not look at the AddWhere function before!!! please mod feel free to delete this Discussion if you find it unuseful.
This discussion has been closed.