Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
query to sqlBuilder question
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.
0
This discussion has been closed.